1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. (c) <optionally add copywriters name>
4 .. _barometer-docker-userguide:
6 ===================================
7 OPNFV Barometer Docker User Guide
8 ===================================
14 The intention of this user guide is to outline how to install and test the Barometer project's
15 docker images. The `OPNFV docker hub <https://hub.docker.com/u/opnfv/?page=1>`_ contains 5 docker
16 images from the Barometer project:
18 1. `Collectd docker image <https://hub.docker.com/r/opnfv/barometer-collectd/>`_
19 2. `Influxdb docker image <https://hub.docker.com/r/opnfv/barometer-influxdb/>`_
20 3. `Grafana docker image <https://hub.docker.com/r/opnfv/barometer-grafana/>`_
21 4. `Kafka docker image <https://hub.docker.com/r/opnfv/barometer-kafka/>`_
22 5. `VES application docker image <https://hub.docker.com/r/opnfv/barometer-ves/>`_
24 For description of images please see section `Barometer Docker Images Description`_
26 For steps to build and run Collectd image please see section `Build and Run Collectd Docker Image`_
28 For steps to build and run InfluxDB and Grafana images please see section `Build and Run InfluxDB and Grafana Docker Images`_
30 For steps to build and run VES and Kafka images please see section `Build and Run VES and Kafka Docker Images`_
32 For overview of running VES application with Kafka please see the :ref:`VES Application User Guide <barometer-ves-userguide>`
34 Barometer Docker Images Description
35 -----------------------------------
37 .. Describe the specific features and how it is realised in the scenario in a brief manner
38 .. to ensure the user understand the context for the user guide instructions to follow.
40 Barometer Collectd Image
41 ^^^^^^^^^^^^^^^^^^^^^^^^
42 The barometer collectd docker image gives you a collectd installation that includes all
43 the barometer plugins.
46 The Dockerfile is available in the docker/barometer-collectd directory in the barometer repo.
47 The Dockerfile builds a CentOS 7 docker image.
48 The container MUST be run as a privileged container.
50 Collectd is a daemon which collects system performance statistics periodically
51 and provides a variety of mechanisms to publish the collected metrics. It
52 supports more than 90 different input and output plugins. Input plugins
53 retrieve metrics and publish them to the collectd deamon, while output plugins
54 publish the data they receive to an end point. Collectd also has infrastructure
55 to support thresholding and notification.
57 Collectd docker image has enabled the following collectd plugins (in addition
58 to the standard collectd plugins):
61 * Open vSwitch events Plugin
62 * Open vSwitch stats Plugin
70 Plugins and third party applications in Barometer repository that will be available in the
73 * Open vSwitch PMD stats
74 * ONAP VES application
79 InfluxDB + Grafana Docker Images
80 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
82 The Barometer project's InfluxDB and Grafana docker images are 2 docker images that database and graph
83 statistics reported by the Barometer collectd docker. InfluxDB is an open-source time series database
84 tool which stores the data from collectd for future analysis via Grafana, which is a open-source
85 metrics anlytics and visualisation suite which can be accessed through any browser.
87 VES + Kafka Docker Images
88 ^^^^^^^^^^^^^^^^^^^^^^^^^
90 The Barometer project's VES application and Kafka docker images are based on a CentOS 7 image. Kafka
91 docker image has a dependancy on `Zookeeper <https://zookeeper.apache.org/>`_. Kafka must be able to
92 connect and register with an instance of Zookeeper that is either running on local or remote host.
93 Kafka recieves and stores metrics recieved from Collectd. VES application pulls latest metrics from Kafka
94 which it normalizes into VES format for sending to a VES collector. Please see details in
95 :ref:`VES Application User Guide <barometer-ves-userguide>`
97 One Click Install with Ansible
98 ------------------------------
100 Proxy for package manager on host
101 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
103 This step has to be performed only if host is behind HTTP/HTTPS proxy
105 Proxy URL have to be set in dedicated config file
107 1. CentOS - /etc/yum.conf
111 proxy=http://your.proxy.domain:1234
113 2. Ubuntu - /etc/apt/apt.conf
117 Acquire::http::Proxy "http://your.proxy.domain:1234"
119 After update of config file, apt mirrors have to be updated via 'apt-get update'
123 $ sudo apt-get update
125 Proxy environment variables(for docker and pip)
126 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
128 This step has to be performed only if host is behind HTTP/HTTPS proxy
130 Configuring proxy for packaging system is not enough, also some proxy
131 environment variables have to be set in the system before ansible scripts
133 Barometer configures docker proxy automatically via ansible task as a part
134 of 'one click install' process - user only has to provide proxy URL using common
135 shell environment variables and ansible will automatically configure proxies
136 for docker(to be able to fetch barometer images). Another component used by
137 ansible (e.g. pip is used for downloading python dependencies) will also benefit
138 from setting proxy variables properly in the system.
140 Proxy variables used by ansible One Click Install:
146 Variables mentioned above have to be visible for superuser (because most
147 actions involving ansible-barometer installation require root privileges).
148 Proxy variables are commonly defined in '/etc/environment' file (but any other
149 place is good as long as variables can be seen by commands using 'su').
151 Sample proxy configuration in /etc/environment:
155 http_proxy=http://your.proxy.domain:1234
156 https_proxy=http://your.proxy.domain:1234
157 ftp_proxy=http://your.proxy.domain:1234
163 * sudo permissions or root access are required to install ansible.
164 * ansible version needs to be 2.4+, because usage of import/include statements
166 The following steps have been verified with Ansible 2.6.3 on Ubuntu 16.04 and 18.04.
167 To install Ansible 2.6.3 on Ubuntu:
171 $ sudo apt-get install python
172 $ sudo apt-get install python-pip
173 $ sudo pip install 'ansible==2.6.3'
175 The following steps have been verified with Ansible 2.6.3 on Centos 7.5.
176 To install Ansible 2.6.3 on Centos:
180 $ sudo yum install python
181 $ sudo yum install epel-release
182 $ sudo yum install python-pip
183 $ sudo pip install 'ansible==2.6.3'
190 $ git clone https://gerrit.opnfv.org/gerrit/barometer
191 $ cd barometer/docker/ansible
195 Edit inventory file and add hosts: $barometer_dir/docker/ansible/default.inv
202 [collectd_hosts:vars]
204 insert_ipmi_modules=true
221 Change localhost to different hosts where neccessary.
222 Hosts for influxdb and grafana are required only for collectd_service.yml.
223 Hosts for kafka and ves are required only for collectd_ves.yml.
225 To change host for kafka edit kafka_ip_addr in ./roles/config_files/vars/main.yml.
227 Additional plugin dependencies
228 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
230 By default ansible will try to fulfill dependencies for mcelog and ipmi plugin.
231 For mcelog plugin it installs mcelog daemon. For ipmi it tries to insert ipmi_devintf
232 and ipmi_si kernel modules.
233 This can be changed in inventory file with use of variables install_mcelog
234 and insert_ipmi_modules, both variables are independent:
238 [collectd_hosts:vars]
240 insert_ipmi_modules=false
243 On Ubuntu 18.04 to use mcelog plugin the user has to install mcelog daemon
244 manually ahead of installing from ansible scripts as the deb package is not
245 available in official Ubuntu 18.04 repo. It means that setting install_mcelog
251 Generate ssh keys if not present, otherwise move onto next step.
257 Copy ssh key to all target hosts. It requires to provide root password.
258 The example is for localhost.
263 $ ssh-copy-id root@localhost
265 Verify that key is added and password is not required to connect.
269 $ sudo ssh root@localhost
272 Keys should be added to every target host and [localhost] is only used as an
273 example. For multinode installation keys need to be copied for each node:
274 [collectd_hostname], [influxdb_hostname] etc.
276 Download and run Collectd+Influxdb+Grafana containers
277 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
279 The One Click installation features easy and scalable deployment of Collectd,
280 Influxdb and Grafana containers using Ansible playbook. The following steps goes
281 through more details.
285 $ sudo ansible-playbook -i default.inv collectd_service.yml
287 Check the three containers are running, the output of docker ps should be similar to:
292 CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
293 a033aeea180d opnfv/barometer-grafana "/run.sh" 9 days ago Up 7 minutes bar-grafana
294 1bca2e4562ab opnfv/barometer-influxdb "/entrypoint.sh in..." 9 days ago Up 7 minutes bar-influxdb
295 daeeb68ad1d5 opnfv/barometer-collectd "/run_collectd.sh ..." 9 days ago Up 7 minutes bar-collectd
297 To make some changes when a container is running run:
301 $ sudo docker exec -ti <CONTAINER ID> /bin/bash
303 Connect to <host_ip>:3000 with a browser and log into Grafana: admin/admin.
304 For short introduction please see the:
305 `Grafana guide <http://docs.grafana.org/guides/getting_started/>`_.
307 The collectd configuration files can be accessed directly on target system in '/opt/collectd/etc/collectd.conf.d'.
308 It can be used for manual changes or enable/disable plugins. If configuration has been modified it is required to
313 $ sudo docker restart bar-collectd
315 Download collectd+kafka+ves containers
316 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
318 Before running Kafka an instance of zookeeper is required. See `Run Kafka docker image`_ for notes on how to run it.
319 The 'zookeeper_hostname' and 'broker_id' can be set in ./roles/run_kafka/vars/main.yml.
323 $ sudo ansible-playbook -i default.inv collectd_ves.yml
325 Check the three containers are running, the output of docker ps should be similar to:
330 CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
331 8b095ad94ea1 zookeeper:3.4.11 "/docker-entrypoin..." 7 minutes ago Up 7 minutes awesome_jennings
332 eb8bba3c0b76 opnfv/barometer-ves "./start_ves_app.s..." 21 minutes ago Up 6 minutes bar-ves
333 86702a96a68c opnfv/barometer-kafka "/src/start_kafka.sh" 21 minutes ago Up 6 minutes bar-kafka
334 daeeb68ad1d5 opnfv/barometer-collectd "/run_collectd.sh ..." 13 days ago Up 6 minutes bar-collectd
337 To make some changes when a container is running run:
341 $ sudo docker exec -ti <CONTAINER ID> /bin/bash
343 List of default plugins for collectd container
344 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
346 By default the collectd is started with default configuration which includes the followin plugins:
347 * csv, contextswitch, cpu, cpufreq, df, disk, ethstat, ipc, irq, load, memory, numa, processes,
348 swap, turbostat, uuid, uptime, exec, hugepages, intel_pmu, ipmi, write_kafka, logfile, mcelog,
349 network, intel_rdt, rrdtool, snmp_agent, syslog, virt, ovs_stats, ovs_events
351 Some of the plugins are loaded depending on specific system requirements and can be omitted if
352 dependency is not met, this is the case for:
353 * hugepages, ipmi, mcelog, intel_rdt, virt, ovs_stats, ovs_events
355 List and description of tags used in ansible scripts
356 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
358 Tags can be used to run a specific part of the configuration without running the whole playbook.
359 To run a specific parts only:
363 $ sudo ansible-playbook -i default.inv collectd_service.yml --tags "syslog,cpu,uuid"
365 To disable some parts or plugins:
369 $ sudo ansible-playbook -i default.inv collectd_service.yml --skip-tags "en_default_all,syslog,cpu,uuid"
371 List of available tags:
374 Install docker and required dependencies with package manager.
377 Configure proxy file for docker service if proxy is set on host environment.
380 Remove collectd config files.
382 copy_additional_configs
383 Copy additional configuration files to target system. Path to additional configuration
384 is stored in $barometer_dir/docker/ansible/roles/config_files/vars/main.yml as additional_configs_path.
387 Set of default read plugins: contextswitch, cpu, cpufreq, df, disk, ethstat, ipc, irq,
388 load, memory, numa, processes, swap, turbostat, uptime.
391 The following tags can be used to enable/disable plugins: csv, contextswitch, cpu,
392 cpufreq, df, disk, ethstat, ipc, irq, load, memory, numa, processes, swap, turbostat,
393 uptime, exec, hugepages, ipmi, kafka, logfile, mcelogs, network, pmu, rdt, rrdtool,
394 snmp, syslog, virt, ovs_stats, ovs_events, uuid.
398 .. Describe the specific capabilities and usage for <XYZ> feature.
399 .. Provide enough information that a user will be able to operate the feature on a deployed scenario.
402 The below sections provide steps for manual installation and configuration
403 of docker images. They are not neccessary if docker images were installed with
404 use of Ansible-Playbook.
409 * sudo permissions are required to install docker.
410 * These instructions are for Ubuntu 16.10
416 $ sudo apt-get install curl
417 $ sudo curl -fsSL https://get.docker.com/ | sh
418 $ sudo usermod -aG docker <username>
419 $ sudo systemctl status docker
421 Replace <username> above with an appropriate user name.
426 * sudo permissions are required to install docker.
427 * These instructions are for CentOS 7
433 $ sudo yum remove docker docker-common docker-selinux docker-engine
434 $ sudo yum install -y yum-utils device-mapper-persistent-data lvm2
435 $ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
436 $ sudo yum-config-manager --enable docker-ce-edge
437 $ sudo yum-config-manager --enable docker-ce-test
438 $ sudo yum install docker-ce
439 $ sudo usermod -aG docker <username>
440 $ sudo systemctl status docker
442 Replace <username> above with an appropriate user name.
445 If this is the first time you are installing a package from a recently added
446 repository, you will be prompted to accept the GPG key, and the key’s
447 fingerprint will be shown. Verify that the fingerprint is correct, and if so,
448 accept the key. The fingerprint should match060A 61C5 1B55 8A7F 742B 77AA C52F
451 Retrieving key from https://download.docker.com/linux/centos/gpg
452 Importing GPG key 0x621E9F35:
453 Userid : "Docker Release (CE rpm) <docker@docker.com>"
454 Fingerprint: 060a 61c5 1b55 8a7f 742b 77aa c52f eb6b 621e 9f35
455 From : https://download.docker.com/linux/centos/gpg
458 Manual proxy configuration for docker
459 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
462 This applies for both CentOS and Ubuntu.
464 If you are behind an HTTP or HTTPS proxy server, you will need to add this
465 configuration in the Docker systemd service file.
467 1. Create a systemd drop-in directory for the docker service:
471 $ sudo mkdir -p /etc/systemd/system/docker.service.d
474 called /etc/systemd/system/docker.service.d/http-proxy.conf that adds
475 the HTTP_PROXY environment variable:
480 Environment="HTTP_PROXY=http://proxy.example.com:80/"
482 Or, if you are behind an HTTPS proxy server, create a file
483 called /etc/systemd/system/docker.service.d/https-proxy.conf that adds
484 the HTTPS_PROXY environment variable:
489 Environment="HTTPS_PROXY=https://proxy.example.com:443/"
491 Or create a single file with all the proxy configurations:
492 /etc/systemd/system/docker.service.d/proxy.conf
497 Environment="HTTP_PROXY=http://proxy.example.com:80/"
498 Environment="HTTPS_PROXY=https://proxy.example.com:443/"
499 Environment="FTP_PROXY=ftp://proxy.example.com:443/"
500 Environment="NO_PROXY=localhost"
506 $ sudo systemctl daemon-reload
512 $ sudo systemctl restart docker
514 5. Check docker environment variables:
518 sudo systemctl show --property=Environment docker
520 Test docker installation
521 ^^^^^^^^^^^^^^^^^^^^^^^^
523 This applies for both CentOS and Ubuntu.
527 $ sudo docker run hello-world
529 The output should be something like:
533 Unable to find image 'hello-world:latest' locally
534 latest: Pulling from library/hello-world
535 5b0f327be733: Pull complete
536 Digest: sha256:07d5f7800dfe37b8c2196c7b1c524c33808ce2e0f74e7aa00e603295ca9a0972
537 Status: Downloaded newer image for hello-world:latest
540 This message shows that your installation appears to be working correctly.
542 To generate this message, Docker took the following steps:
543 1. The Docker client contacted the Docker daemon.
544 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
545 3. The Docker daemon created a new container from that image which runs the
546 executable that produces the output you are currently reading.
547 4. The Docker daemon streamed that output to the Docker client, which sent it
550 To try something more ambitious, you can run an Ubuntu container with:
554 $ docker run -it ubuntu bash
556 Build and Run Collectd Docker Image
557 -----------------------------------
559 Download the collectd docker image
560 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
561 If you wish to use a pre-built barometer image, you can pull the barometer
562 image from https://hub.docker.com/r/opnfv/barometer-collectd/
566 $ docker pull opnfv/barometer-collectd
568 Build the collectd docker image
569 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
573 $ git clone https://gerrit.opnfv.org/gerrit/barometer
574 $ cd barometer/docker/barometer-collectd
575 $ sudo docker build -t opnfv/barometer-collectd --build-arg http_proxy=`echo $http_proxy` \
576 --build-arg https_proxy=`echo $https_proxy` --network=host -f Dockerfile .
579 Main directory of barometer source code (directory that contains 'docker',
580 'docs', 'src' and systems sub-directories) will be referred as
581 ``<BAROMETER_REPO_DIR>``
585 In the above mentioned ``docker build`` command, http_proxy & https_proxy arguments needs to be
586 passed only if system is behind an HTTP or HTTPS proxy server.
588 Check the docker images:
594 Output should contain a barometer-collectd image:
598 REPOSITORY TAG IMAGE ID CREATED SIZE
599 opnfv/barometer-collectd latest 05f2a3edd96b 3 hours ago 1.2GB
600 centos 7 196e0ce0c9fb 4 weeks ago 197MB
601 centos latest 196e0ce0c9fb 4 weeks ago 197MB
602 hello-world latest 05a3bd381fc2 4 weeks ago 1.84kB
604 Run the collectd docker image
605 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
608 $ cd <BAROMETER_REPO_DIR>
609 $ sudo docker run -ti --net=host -v \
610 `pwd`/src/collectd/collectd_sample_configs:/opt/collectd/etc/collectd.conf.d \
611 -v /var/run:/var/run -v /tmp:/tmp --privileged opnfv/barometer-collectd
614 The docker collectd image contains configuration for all the collectd
615 plugins. In the command above we are overriding
616 /opt/collectd/etc/collectd.conf.d by mounting a host directory
617 src/collectd/collectd_sample_configs that contains only the sample
618 configurations we are interested in running.
620 *If some dependencies for plugins listed in configuration directory
621 aren't met, then collectd startup may fail(collectd tries to
622 initialize plugins configurations for all given config files that can
623 be found in shared configs directory and may fail if some dependency
626 If `DPDK` or `RDT` can't be installed on host, then corresponding config
627 files should be removed from shared configuration directory
628 (`<BAROMETER_REPO_DIR>/src/collectd/collectd_sample_configs/`) prior
629 to starting barometer-collectd container. By example: in case of missing
630 `DPDK` functionality on the host, `dpdkstat.conf` and `dpdkevents.conf`
633 Sample configurations can be found at:
634 https://github.com/opnfv/barometer/tree/master/src/collectd/collectd_sample_configs
636 List of barometer-collectd dependencies on host for various plugins
638 https://wiki.opnfv.org/display/fastpath/Barometer-collectd+host+dependencies
640 Check your docker image is running
646 To make some changes when the container is running run:
650 sudo docker exec -ti <CONTAINER ID> /bin/bash
652 Build and Run InfluxDB and Grafana docker images
653 ------------------------------------------------
657 The barometer-influxdb image is based on the influxdb:1.3.7 image from the influxdb dockerhub. To
658 view detils on the base image please visit
659 `https://hub.docker.com/_/influxdb/ <https://hub.docker.com/_/influxdb/>`_ Page includes details of
660 exposed ports and configurable enviromental variables of the base image.
662 The barometer-grafana image is based on grafana:4.6.3 image from the grafana dockerhub. To view
663 details on the base image please visit
664 `https://hub.docker.com/r/grafana/grafana/ <https://hub.docker.com/r/grafana/grafana/>`_ Page
665 includes details on exposed ports and configurable enviromental variables of the base image.
667 The barometer-grafana image includes pre-configured source and dashboards to display statistics exposed
668 by the barometer-collectd image. The default datasource is an influxdb database running on localhost
669 but the address of the influxdb server can be modified when launching the image by setting the
670 environmental variables influxdb_host to IP or hostname of host on which influxdb server is running.
672 Additional dashboards can be added to barometer-grafana by mapping a volume to /opt/grafana/dashboards.
673 Incase where a folder is mounted to this volume only files included in this folder will be visible
674 inside barometer-grafana. To ensure all default files are also loaded please ensure they are included in
675 volume folder been mounted. Appropriate example are given in section `Run the Grafana docker image`_
677 Download the InfluxDB and Grafana docker images
678 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
679 If you wish to use pre-built barometer project's influxdb and grafana images, you can pull the
680 images from https://hub.docker.com/r/opnfv/barometer-influxdb/ and https://hub.docker.com/r/opnfv/barometer-grafana/
683 If your preference is to build images locally please see sections `Build InfluxDB Docker Image`_ and
684 `Build Grafana Docker Image`_
688 $ docker pull opnfv/barometer-influxdb
689 $ docker pull opnfv/barometer-grafana
692 If you have pulled the pre-built barometer-influxdb and barometer-grafana images there is no
693 requirement to complete steps outlined in sections `Build InfluxDB Docker Image`_ and
694 `Build Grafana Docker Image`_ and you can proceed directly to section
695 `Run the Influxdb and Grafana Images`_
697 Build InfluxDB docker image
698 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
700 Build influxdb image from Dockerfile
704 $ cd barometer/docker/barometer-influxdb
705 $ sudo docker build -t opnfv/barometer-influxdb --build-arg http_proxy=`echo $http_proxy` \
706 --build-arg https_proxy=`echo $https_proxy` --network=host -f Dockerfile .
709 In the above mentioned ``docker build`` command, http_proxy & https_proxy arguments needs to
710 be passed only if system is behind an HTTP or HTTPS proxy server.
712 Check the docker images:
718 Output should contain an influxdb image:
722 REPOSITORY TAG IMAGE ID CREATED SIZE
723 opnfv/barometer-influxdb latest 1e4623a59fe5 3 days ago 191MB
725 Build Grafana docker image
726 ^^^^^^^^^^^^^^^^^^^^^^^^^^
728 Build Grafana image from Dockerfile
732 $ cd barometer/docker/barometer-grafana
733 $ sudo docker build -t opnfv/barometer-grafana --build-arg http_proxy=`echo $http_proxy` \
734 --build-arg https_proxy=`echo $https_proxy` -f Dockerfile .
737 In the above mentioned ``docker build`` command, http_proxy & https_proxy arguments needs to
738 be passed only if system is behind an HTTP or HTTPS proxy server.
740 Check the docker images:
746 Output should contain an influxdb image:
750 REPOSITORY TAG IMAGE ID CREATED SIZE
751 opnfv/barometer-grafana latest 05f2a3edd96b 3 hours ago 1.2GB
753 Run the Influxdb and Grafana Images
754 -----------------------------------
756 Run the InfluxDB docker image
757 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
760 $ sudo docker run -tid -v /var/lib/influxdb:/var/lib/influxdb --net=host\
761 --name bar-influxdb opnfv/barometer-influxdb
763 Check your docker image is running
769 To make some changes when the container is running run:
773 sudo docker exec -ti <CONTAINER ID> /bin/bash
775 Run the Grafana docker image
776 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
778 Connecting to an influxdb instance running on local system and adding own custom dashboards
782 $ cd <BAROMETER_REPO_DIR>
783 $ sudo docker run -tid -v /var/lib/grafana:/var/lib/grafana \
784 -v ${PWD}/docker/barometer-grafana/dashboards:/opt/grafana/dashboards \
785 --name bar-grafana --net=host opnfv/barometer-grafana
787 Connecting to an influxdb instance running on remote system with hostname of someserver and IP address
792 $ sudo docker run -tid -v /var/lib/grafana:/var/lib/grafana --net=host -e \
793 influxdb_host=someserver --add-host someserver:192.168.121.111 --name \
794 bar-grafana opnfv/barometer-grafana
796 Check your docker image is running
802 To make some changes when the container is running run:
806 sudo docker exec -ti <CONTAINER ID> /bin/bash
808 Connect to <host_ip>:3000 with a browser and log into grafana: admin/admin
811 Build and Run VES and Kafka Docker Images
812 ------------------------------------------
814 Download VES and Kafka docker images
815 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
817 If you wish to use pre-built barometer project's VES and kafka images, you can pull the
818 images from https://hub.docker.com/r/opnfv/barometer-ves/ and https://hub.docker.com/r/opnfv/barometer-kafka/
821 If your preference is to build images locally please see sections `Build the Kafka Image`_ and
826 $ docker pull opnfv/barometer-kafka
827 $ docker pull opnfv/barometer-ves
830 If you have pulled the pre-built images there is no requirement to complete steps outlined
831 in sections `Build Kafka Docker Image`_ and `Build VES Docker Image`_ and you can proceed directly to section
832 `Run Kafka Docker Image`_
834 Build Kafka docker image
835 ^^^^^^^^^^^^^^^^^^^^^^^^
837 Build Kafka docker image:
841 $ cd barometer/docker/barometer-kafka
842 $ sudo docker build -t opnfv/barometer-kafka --build-arg http_proxy=`echo $http_proxy` \
843 --build-arg https_proxy=`echo $https_proxy` -f Dockerfile .
846 In the above mentioned ``docker build`` command, http_proxy & https_proxy arguments needs
847 to be passed only if system is behind an HTTP or HTTPS proxy server.
849 Check the docker images:
855 Output should contain a barometer image:
859 REPOSITORY TAG IMAGE ID CREATED SIZE
860 opnfv/barometer-kafka latest 05f2a3edd96b 3 hours ago 1.2GB
862 Build VES docker image
863 ^^^^^^^^^^^^^^^^^^^^^^
865 Build VES application docker image:
869 $ cd barometer/docker/barometer-ves
870 $ sudo docker build -t opnfv/barometer-ves --build-arg http_proxy=`echo $http_proxy` \
871 --build-arg https_proxy=`echo $https_proxy` -f Dockerfile .
874 In the above mentioned ``docker build`` command, http_proxy & https_proxy arguments needs
875 to be passed only if system is behind an HTTP or HTTPS proxy server.
877 Check the docker images:
883 Output should contain a barometer image:
887 REPOSITORY TAG IMAGE ID CREATED SIZE
888 opnfv/barometer-ves latest 05f2a3edd96b 3 hours ago 1.2GB
890 Run Kafka docker image
891 ^^^^^^^^^^^^^^^^^^^^^^
894 Before running Kafka an instance of Zookeeper must be running for the Kafka broker to register
895 with. Zookeeper can be running locally or on a remote platform. Kafka's broker_id and address of
896 its zookeeper instance can be configured by setting values for environmental variables 'broker_id'
897 and 'zookeeper_node'. In instance where 'broker_id' and/or 'zookeeper_node' is not set the default
898 setting of broker_id=0 and zookeeper_node=localhost is used. In intance where Zookeeper is running
899 on same node as Kafka and there is a one to one relationship between Zookeeper and Kafka, default
900 setting can be used. The docker argument `add-host` adds hostname and IP address to
901 /etc/hosts file in container
903 Run zookeeper docker image:
907 $ sudo docker run -tid --net=host -p 2181:2181 zookeeper:3.4.11
909 Run kafka docker image which connects with a zookeeper instance running on same node with a 1:1 relationship
913 $ sudo docker run -tid --net=host -p 9092:9092 opnfv/barometer-kafka
916 Run kafka docker image which connects with a zookeeper instance running on a node with IP address of
917 192.168.121.111 using broker ID of 1
921 $ sudo docker run -tid --net=host -p 9092:9092 --env broker_id=1 --env zookeeper_node=zookeeper --add-host \
922 zookeeper:192.168.121.111 opnfv/barometer-kafka
924 Run VES Application docker image
925 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
927 VES application uses configuration file ves_app_config.conf from directory
928 barometer/3rd_party/collectd-ves-app/ves_app/config/ and host.yaml file from
929 barometer/3rd_party/collectd-ves-app/ves_app/yaml/ by default. If you wish to use a custom config
930 file it should be mounted to mount point /opt/ves/config/ves_app_config.conf. To use an alternative yaml
931 file from folder barometer/3rd_party/collectd-ves-app/ves_app/yaml the name of the yaml file to use
932 should be passed as an additional command. If you wish to use a custom file the file should be
933 mounted to mount point /opt/ves/yaml/ Please see examples below
935 Run VES docker image with default configuration
939 $ sudo docker run -tid --net=host opnfv/barometer-ves
941 Run VES docker image with guest.yaml files from barometer/3rd_party/collectd-ves-app/ves_app/yaml/
945 $ sudo docker run -tid --net=host opnfv/barometer-ves guest.yaml
948 Run VES docker image with using custom config and yaml files. In example below yaml/ folder cotains
949 file named custom.yaml
953 $ sudo docker run -tid --net=host -v ${PWD}/custom.config:/opt/ves/config/ves_app_config.conf \
954 -v ${PWD}/yaml/:/opt/ves/yaml/ opnfv/barometer-ves custom.yaml
956 Run VES Test Collector application
957 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
959 VES Test Collector application can be used for displaying platform
960 wide metrics that are collected by barometer-ves container.
961 Setup instructions are located in: :ref:`Setup VES Test Collector`
963 Build and Run DMA and Redis Docker Images
964 -----------------------------------------------------
966 Download DMA docker images
967 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
969 If you wish to use pre-built barometer project's DMA images, you can pull the
970 images from https://hub.docker.com/r/opnfv/barometer-dma/
973 If your preference is to build images locally please see sections `Build DMA Docker Image`_
977 $ docker pull opnfv/barometer-dma
980 If you have pulled the pre-built images there is no requirement to complete steps outlined
981 in sections `Build DMA Docker Image`_ and you can proceed directly to section
982 `Run DMA Docker Image`_
984 Build DMA docker image
985 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
987 Build DMA docker image:
991 $ cd barometer/docker/barometer-dma
992 $ sudo docker build -t opnfv/barometer-dma --build-arg http_proxy=`echo $http_proxy` \
993 --build-arg https_proxy=`echo $https_proxy` -f Dockerfile .
996 In the above mentioned ``docker build`` command, http_proxy & https_proxy arguments needs
997 to be passed only if system is behind an HTTP or HTTPS proxy server.
999 Check the docker images:
1003 $ sudo docker images
1005 Output should contain a barometer image:
1009 REPOSITORY TAG IMAGE ID CREATED SIZE
1010 opnfv/barometer-dma latest 2f14fbdbd498 3 hours ago 941 MB
1012 Run Redis docker image
1013 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1016 Before running DMA, Redis must be running.
1018 Run Redis docker image:
1022 $ sudo docker run -tid -p 6379:6379 --name barometer-redis redis
1024 Check your docker image is running
1030 Run DMA docker image
1031 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1034 Run DMA docker image with default configuration
1038 $ cd barometer/docker/barometer-dma
1039 $ sudo mkdir /etc/barometer-dma
1040 $ sudo cp ../../src/dma/examples/config.toml /etc/barometer-dma/
1041 $ sudo vi /etc/barometer-dma/config.toml
1042 (edit amqp_password and os_password:OpenStack admin password)
1045 (When there is no key for SSH access authentication)
1047 (Press Enter until done)
1048 (Backup if necessary)
1049 # cp ~/.ssh/authorized_keys ~/.ssh/authorized_keys_org
1050 # cat ~/.ssh/authorized_keys_org ~/.ssh/id_rsa.pub \
1051 > ~/.ssh/authorized_keys
1054 $ sudo docker run -tid --net=host --name server \
1055 -v /etc/barometer-dma:/etc/barometer-dma \
1056 -v /root/.ssh/id_rsa:/root/.ssh/id_rsa \
1057 -v /etc/collectd/collectd.conf.d:/etc/collectd/collectd.conf.d \
1058 opnfv/barometer-dma /server
1060 $ sudo docker run -tid --net=host --name infofetch \
1061 -v /etc/barometer-dma:/etc/barometer-dma \
1062 -v /var/run/libvirt:/var/run/libvirt \
1063 opnfv/barometer-dma /infofetch
1065 (Execute when installing the threshold evaluation binary)
1066 $ sudo docker cp infofetch:/threshold ./
1067 $ sudo ln -s ${PWD}/threshold /usr/local/bin/
1071 .. [1] https://docs.docker.com/engine/admin/systemd/#httphttps-proxy
1072 .. [2] https://docs.docker.com/engine/installation/linux/docker-ce/centos/#install-using-the-repository
1073 .. [3] https://docs.docker.com/engine/userguide/