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 Download and Run Docker Images with Ansible-Playbook
98 ----------------------------------------------------
103 * sudo permissions or root access are required to install ansible.
104 * ansible version needs to be 2.4+, because usage of import/include statements
106 To install Ansible 2.6.3 on Ubuntu:
110 $ sudo apt-get install python
111 $ sudo apt-get install python-pip
112 $ sudo pip install 'ansible==2.6.3'
114 To install Ansible 2.6.3 on Centos:
118 $ sudo yum install python
119 $ sudo yum install epel-release
120 $ sudo yum install python-pip
121 $ sudo pip install 'ansible==2.6.3'
128 $ git clone https://gerrit.opnfv.org/gerrit/barometer
129 $ cd barometer/docker/ansible
133 Edit inventory file and add hosts: ~/default.inv
140 [collectd_hosts:vars]
142 insert_ipmi_modules=true
159 Change localhost to different hosts where neccessary.
160 Hosts for influxdb and grafana are required only for collectd_service.yml.
161 Hosts for kafka and ves are required only for collectd_ves.yml.
163 To change host for kafka edit kafka_ip_addr in ./roles/config_files/vars/main.yml.
165 Additional plugin dependencies
166 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
168 By default ansible will try to fulfill dependencies for mcelog and ipmi plugin.
169 For mcelog plugin it installs mcelog daemon. For ipmi it tries to insert ipmi_devintf
170 and ipmi_si kernel modules.
171 This can be changed in inventory file with use of variables install_mcelog
172 and insert_ipmi_modules, both variables are independent:
176 [collectd_hosts:vars]
178 insert_ipmi_modules=false
183 Generate ssh keys if not present, otherwise move onto next step.
189 Coppy ssh key to all target hosts. It requires to provide root password. The example is for localhost.
193 $ sudo ssh-copy-id root@localhost
195 Download collectd+influxdb+grafana containers
196 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
200 $ sudo ansible-playbook -i ~/default.inv collectd_service.yml
202 Check the three containers are running, the output of docker ps should be similar to:
207 CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
208 a033aeea180d opnfv/barometer-grafana "/run.sh" 9 days ago Up 7 minutes bar-grafana
209 1bca2e4562ab opnfv/barometer-influxdb "/entrypoint.sh in..." 9 days ago Up 7 minutes bar-influxdb
210 daeeb68ad1d5 opnfv/barometer-collectd "/run_collectd.sh ..." 9 days ago Up 7 minutes bar-collectd
212 To make some changes when a container is running run:
216 $ sudo docker exec -ti <CONTAINER ID> /bin/bash
218 Connect to <host_ip>:3000 with a browser and log into grafana: admin/admin
220 The collectd configuration files can be accessed directly on target system in '/opt/collectd/etc/collectd.conf.d'.
221 It can be used for manual changes or enable/disable plugins. If configuration has been modified it is required to
226 $ sudo docker restart bar-collectd
228 Download collectd+kafka+ves containers
229 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
231 Before running Kafka an instance of zookeeper is required. See `Run Kafka docker image`_ for notes on how to run it.
232 The 'zookeeper_hostname' and 'broker_id' can be set in ./roles/run_kafka/vars/main.yml.
236 $ sudo ansible-playbook -i ~/default.inv collectd_ves.yml
238 Check the three containers are running, the output of docker ps should be similar to:
243 CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
244 8b095ad94ea1 zookeeper:3.4.11 "/docker-entrypoin..." 7 minutes ago Up 7 minutes awesome_jennings
245 eb8bba3c0b76 opnfv/barometer-ves "./start_ves_app.s..." 21 minutes ago Up 6 minutes bar-ves
246 86702a96a68c opnfv/barometer-kafka "/src/start_kafka.sh" 21 minutes ago Up 6 minutes bar-kafka
247 daeeb68ad1d5 opnfv/barometer-collectd "/run_collectd.sh ..." 13 days ago Up 6 minutes bar-collectd
250 To make some changes when a container is running run:
254 $ sudo docker exec -ti <CONTAINER ID> /bin/bash
256 List of default plugins for collectd container
257 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
259 By default the collectd is started with default configuration which includes the followin plugins:
260 * csv, contextswitch, cpu, cpufreq, df, disk, ethstat, ipc, irq, load, memory, numa, processes,
261 swap, turbostat, uuid, uptime, exec, hugepages, intel_pmu, ipmi, write_kafka, logfile, mcelog,
262 network, intel_rdt, rrdtool, snmp_agent, syslog, virt, ovs_stats, ovs_events
264 Some of the plugins are loaded depending on specific system requirements and can be omitted if
265 dependency is not met, this is the case for:
266 * hugepages, ipmi, mcelog, intel_rdt, virt, ovs_stats, ovs_events
268 List and description of tags used in ansible scripts
269 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
271 Tags can be used to run a specific part of the configuration without running the whole playbook.
272 To run a specific parts only:
276 $ sudo ansible-playbook -i ~/default.inv collectd_service.yml --tags "syslog,cpu,uuid"
278 To disable some parts or plugins:
282 $ sudo ansible-playbook -i ~/default.inv collectd_service.yml --skip-tags "en_default_all,syslog,cpu,uuid"
284 List of available tags:
287 Install docker and required dependencies with package manager.
290 Configure proxy file for docker service if proxy is set on host environment.
293 Remove collectd config files.
295 copy_additional_configs
296 Copy additional configuration files to target system. Path to additional configuration
297 is stored in $barometer_dir/docker/ansible/roles/config_files/vars/main.yml as additional_configs_path.
300 Set of default read plugins: contextswitch, cpu, cpufreq, df, disk, ethstat, ipc, irq,
301 load, memory, numa, processes, swap, turbostat, uptime.
304 The following tags can be used to enable/disable plugins: csv, contextswitch, cpu,
305 cpufreq, df, disk, ethstat, ipc, irq, load, memory, numa, processes, swap, turbostat,
306 uptime, exec, hugepages, ipmi, kafka, logfile, mcelogs, network, pmu, rdt, rrdtool,
307 snmp, syslog, virt, ovs_stats, ovs_events, uuid.
311 .. Describe the specific capabilities and usage for <XYZ> feature.
312 .. Provide enough information that a user will be able to operate the feature on a deployed scenario.
317 * sudo permissions are required to install docker.
318 * These instructions are for Ubuntu 16.10
324 $ sudo apt-get install curl
325 $ sudo curl -fsSL https://get.docker.com/ | sh
326 $ sudo usermod -aG docker <username>
327 $ sudo systemctl status docker
329 Replace <username> above with an appropriate user name.
334 * sudo permissions are required to install docker.
335 * These instructions are for CentOS 7
341 $ sudo yum remove docker docker-common docker-selinux docker-engine
342 $ sudo yum install -y yum-utils device-mapper-persistent-data lvm2
343 $ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
344 $ sudo yum-config-manager --enable docker-ce-edge
345 $ sudo yum-config-manager --enable docker-ce-test
346 $ sudo yum install docker-ce
347 $ sudo usermod -aG docker <username>
348 $ sudo systemctl status docker
350 Replace <username> above with an appropriate user name.
353 If this is the first time you are installing a package from a recently added
354 repository, you will be prompted to accept the GPG key, and the key’s
355 fingerprint will be shown. Verify that the fingerprint is correct, and if so,
356 accept the key. The fingerprint should match060A 61C5 1B55 8A7F 742B 77AA C52F
359 Retrieving key from https://download.docker.com/linux/centos/gpg
360 Importing GPG key 0x621E9F35:
361 Userid : "Docker Release (CE rpm) <docker@docker.com>"
362 Fingerprint: 060a 61c5 1b55 8a7f 742b 77aa c52f eb6b 621e 9f35
363 From : https://download.docker.com/linux/centos/gpg
369 This applies for both CentOS and Ubuntu.
371 If you are behind an HTTP or HTTPS proxy server, you will need to add this
372 configuration in the Docker systemd service file.
374 1. Create a systemd drop-in directory for the docker service:
378 $ sudo mkdir -p /etc/systemd/system/docker.service.d
381 called /etc/systemd/system/docker.service.d/http-proxy.conf that adds
382 the HTTP_PROXY environment variable:
387 Environment="HTTP_PROXY=http://proxy.example.com:80/"
389 Or, if you are behind an HTTPS proxy server, create a file
390 called /etc/systemd/system/docker.service.d/https-proxy.conf that adds
391 the HTTPS_PROXY environment variable:
396 Environment="HTTPS_PROXY=https://proxy.example.com:443/"
398 Or create a single file with all the proxy configurations:
399 /etc/systemd/system/docker.service.d/proxy.conf
404 Environment="HTTP_PROXY=http://proxy.example.com:80/"
405 Environment="HTTPS_PROXY=https://proxy.example.com:443/"
406 Environment="FTP_PROXY=ftp://proxy.example.com:443/"
407 Environment="NO_PROXY=localhost"
413 $ sudo systemctl daemon-reload
419 $ sudo systemctl restart docker
421 5. Check docker environment variables:
425 sudo systemctl show --property=Environment docker
427 Test docker installation
428 ^^^^^^^^^^^^^^^^^^^^^^^^
430 This applies for both CentOS and Ubuntu.
434 $ sudo docker run hello-world
436 The output should be something like:
440 Unable to find image 'hello-world:latest' locally
441 latest: Pulling from library/hello-world
442 5b0f327be733: Pull complete
443 Digest: sha256:07d5f7800dfe37b8c2196c7b1c524c33808ce2e0f74e7aa00e603295ca9a0972
444 Status: Downloaded newer image for hello-world:latest
447 This message shows that your installation appears to be working correctly.
449 To generate this message, Docker took the following steps:
450 1. The Docker client contacted the Docker daemon.
451 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
452 3. The Docker daemon created a new container from that image which runs the
453 executable that produces the output you are currently reading.
454 4. The Docker daemon streamed that output to the Docker client, which sent it
457 To try something more ambitious, you can run an Ubuntu container with:
461 $ docker run -it ubuntu bash
463 Build and Run Collectd Docker Image
464 -----------------------------------
466 Download the collectd docker image
467 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
468 If you wish to use a pre-built barometer image, you can pull the barometer
469 image from https://hub.docker.com/r/opnfv/barometer-collectd/
473 $ docker pull opnfv/barometer-collectd
475 Build the collectd docker image
476 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
480 $ git clone https://gerrit.opnfv.org/gerrit/barometer
481 $ cd barometer/docker/barometer-collectd
482 $ sudo docker build -t opnfv/barometer-collectd --build-arg http_proxy=`echo $http_proxy` \
483 --build-arg https_proxy=`echo $https_proxy` -f Dockerfile .
486 In the above mentioned ``docker build`` command, http_proxy & https_proxy arguments needs to be
487 passed only if system is behind an HTTP or HTTPS proxy server.
489 Check the docker images:
495 Output should contain a barometer-collectd image:
499 REPOSITORY TAG IMAGE ID CREATED SIZE
500 opnfv/barometer-collectd latest 05f2a3edd96b 3 hours ago 1.2GB
501 centos 7 196e0ce0c9fb 4 weeks ago 197MB
502 centos latest 196e0ce0c9fb 4 weeks ago 197MB
503 hello-world latest 05a3bd381fc2 4 weeks ago 1.84kB
505 Run the collectd docker image
506 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
509 $ sudo docker run -tid --net=host -v `pwd`/../src/collectd_sample_configs:/opt/collectd/etc/collectd.conf.d \
510 -v /var/run:/var/run -v /tmp:/tmp --privileged opnfv/barometer-collectd /run_collectd.sh
513 The docker collectd image contains configuration for all the collectd plugins. In the command
514 above we are overriding /opt/collectd/etc/collectd.conf.d by mounting a host directory
515 `pwd`/../src/collectd_sample_configs that contains only the sample configurations we are interested
516 in running. *It's important to do this if you don't have DPDK, or RDT installed on the host*.
517 Sample configurations can be found at:
518 https://github.com/opnfv/barometer/tree/master/src/collectd/collectd_sample_configs
520 Check your docker image is running
526 To make some changes when the container is running run:
530 sudo docker exec -ti <CONTAINER ID> /bin/bash
532 Build and Run InfluxDB and Grafana docker images
533 ------------------------------------------------
537 The barometer-influxdb image is based on the influxdb:1.3.7 image from the influxdb dockerhub. To
538 view detils on the base image please visit
539 `https://hub.docker.com/_/influxdb/ <https://hub.docker.com/_/influxdb/>`_ Page includes details of
540 exposed ports and configurable enviromental variables of the base image.
542 The barometer-grafana image is based on grafana:4.6.3 image from the grafana dockerhub. To view
543 details on the base image please visit
544 `https://hub.docker.com/r/grafana/grafana/ <https://hub.docker.com/r/grafana/grafana/>`_ Page
545 includes details on exposed ports and configurable enviromental variables of the base image.
547 The barometer-grafana image includes pre-configured source and dashboards to display statistics exposed
548 by the barometer-collectd image. The default datasource is an influxdb database running on localhost
549 but the address of the influxdb server can be modified when launching the image by setting the
550 environmental variables influxdb_host to IP or hostname of host on which influxdb server is running.
552 Additional dashboards can be added to barometer-grafana by mapping a volume to /opt/grafana/dashboards.
553 Incase where a folder is mounted to this volume only files included in this folder will be visible
554 inside barometer-grafana. To ensure all default files are also loaded please ensure they are included in
555 volume folder been mounted. Appropriate example are given in section `Run the Grafana docker image`_
557 Download the InfluxDB and Grafana docker images
558 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
559 If you wish to use pre-built barometer project's influxdb and grafana images, you can pull the
560 images from https://hub.docker.com/r/opnfv/barometer-influxdb/ and https://hub.docker.com/r/opnfv/barometer-grafana/
563 If your preference is to build images locally please see sections `Build InfluxDB Docker Image`_ and
564 `Build Grafana Docker Image`_
568 $ docker pull opnfv/barometer-influxdb
569 $ docker pull opnfv/barometer-grafana
572 If you have pulled the pre-built barometer-influxdb and barometer-grafana images there is no
573 requirement to complete steps outlined in sections `Build InfluxDB Docker Image`_ and
574 `Build Grafana Docker Image`_ and you can proceed directly to section
575 `Run the Influxdb and Grafana Images`_ If you wish to run the barometer-influxdb and
576 barometer-grafana images via Docker Compose proceed directly to section
579 Build InfluxDB docker image
580 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
582 Build influxdb image from Dockerfile
586 $ cd barometer/docker/barometer-influxdb
587 $ sudo docker build -t opnfv/barometer-influxdb --build-arg http_proxy=`echo $http_proxy` \
588 --build-arg https_proxy=`echo $https_proxy` -f Dockerfile .
591 In the above mentioned ``docker build`` command, http_proxy & https_proxy arguments needs to
592 be passed only if system is behind an HTTP or HTTPS proxy server.
594 Check the docker images:
600 Output should contain an influxdb image:
604 REPOSITORY TAG IMAGE ID CREATED SIZE
605 opnfv/barometer-influxdb latest 1e4623a59fe5 3 days ago 191MB
607 Build Grafana docker image
608 ^^^^^^^^^^^^^^^^^^^^^^^^^^
610 Build Grafana image from Dockerfile
614 $ cd barometer/docker/barometer-grafana
615 $ sudo docker build -t opnfv/barometer-grafana --build-arg http_proxy=`echo $http_proxy` \
616 --build-arg https_proxy=`echo $https_proxy` -f Dockerfile .
619 In the above mentioned ``docker build`` command, http_proxy & https_proxy arguments needs to
620 be passed only if system is behind an HTTP or HTTPS proxy server.
622 Check the docker images:
628 Output should contain an influxdb image:
632 REPOSITORY TAG IMAGE ID CREATED SIZE
633 opnfv/barometer-grafana latest 05f2a3edd96b 3 hours ago 1.2GB
635 Run the Influxdb and Grafana Images
636 -----------------------------------
638 Run the InfluxDB docker image
639 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
642 $ sudo docker run -tid -v /var/lib/influxdb:/var/lib/influxdb -p 8086:8086 -p 25826:25826 opnfv/barometer-influxdb
644 Check your docker image is running
650 To make some changes when the container is running run:
654 sudo docker exec -ti <CONTAINER ID> /bin/bash
656 Run the Grafana docker image
657 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
659 Connecting to an influxdb instance running on local system and adding own custom dashboards
663 $ sudo docker run -tid -v /var/lib/grafana:/var/lib/grafana -v ${PWD}/dashboards:/opt/grafana/dashboards \
664 -p 3000:3000 opnfv/barometer-grafana
666 Connecting to an influxdb instance running on remote system with hostname of someserver and IP address
671 $ sudo docker run -tid -v /var/lib/grafana:/var/lib/grafana -p 3000:3000 -e \
672 influxdb_host=someserver --add-host someserver:192.168.121.111 opnfv/barometer-grafana
674 Check your docker image is running
680 To make some changes when the container is running run:
684 sudo docker exec -ti <CONTAINER ID> /bin/bash
686 Connect to <host_ip>:3000 with a browser and log into grafana: admin/admin
689 Build and Run VES and Kafka Docker Images
690 ------------------------------------------
692 Download VES and Kafka docker images
693 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
695 If you wish to use pre-built barometer project's VES and kafka images, you can pull the
696 images from https://hub.docker.com/r/opnfv/barometer-ves/ and https://hub.docker.com/r/opnfv/barometer-kafka/
699 If your preference is to build images locally please see sections `Build the Kafka Image`_ and
704 $ docker pull opnfv/barometer-kafka
705 $ docker pull opnfv/barometer-ves
708 If you have pulled the pre-built images there is no requirement to complete steps outlined
709 in sections `Build Kafka Docker Image`_ and `Build VES Docker Image`_ and you can proceed directly to section
710 `Run Kafka Docker Image`_ If you wish to run the docker images via Docker Compose proceed directly to section `Docker Compose`_.
712 Build Kafka docker image
713 ^^^^^^^^^^^^^^^^^^^^^^^^
715 Build Kafka docker image:
719 $ cd barometer/docker/barometer-kafka
720 $ sudo docker build -t opnfv/barometer-kafka --build-arg http_proxy=`echo $http_proxy` \
721 --build-arg https_proxy=`echo $https_proxy` -f Dockerfile .
724 In the above mentioned ``docker build`` command, http_proxy & https_proxy arguments needs
725 to be passed only if system is behind an HTTP or HTTPS proxy server.
727 Check the docker images:
733 Output should contain a barometer image:
737 REPOSITORY TAG IMAGE ID CREATED SIZE
738 opnfv/barometer-kafka latest 05f2a3edd96b 3 hours ago 1.2GB
740 Build VES docker image
741 ^^^^^^^^^^^^^^^^^^^^^^
743 Build VES application docker image:
747 $ cd barometer/docker/barometer-ves
748 $ sudo docker build -t opnfv/barometer-ves --build-arg http_proxy=`echo $http_proxy` \
749 --build-arg https_proxy=`echo $https_proxy` -f Dockerfile .
752 In the above mentioned ``docker build`` command, http_proxy & https_proxy arguments needs
753 to be passed only if system is behind an HTTP or HTTPS proxy server.
755 Check the docker images:
761 Output should contain a barometer image:
765 REPOSITORY TAG IMAGE ID CREATED SIZE
766 opnfv/barometer-ves latest 05f2a3edd96b 3 hours ago 1.2GB
768 Run Kafka docker image
769 ^^^^^^^^^^^^^^^^^^^^^^
772 Before running Kafka an instance of Zookeeper must be running for the Kafka broker to register
773 with. Zookeeper can be running locally or on a remote platform. Kafka's broker_id and address of
774 its zookeeper instance can be configured by setting values for environmental variables 'broker_id'
775 and 'zookeeper_node'. In instance where 'broker_id' and/or 'zookeeper_node' is not set the default
776 setting of broker_id=0 and zookeeper_node=localhost is used. In intance where Zookeeper is running
777 on same node as Kafka and there is a one to one relationship between Zookeeper and Kafka, default
778 setting can be used. The docker argument `add-host` adds hostname and IP address to
779 /etc/hosts file in container
781 Run zookeeper docker image:
785 $ sudo docker run -tid --net=host -p 2181:2181 zookeeper:3.4.11
787 Run kafka docker image which connects with a zookeeper instance running on same node with a 1:1 relationship
791 $ sudo docker run -tid --net=host -p 9092:9092 opnfv/barometer-kafka
794 Run kafka docker image which connects with a zookeeper instance running on a node with IP address of
795 192.168.121.111 using broker ID of 1
799 $ sudo docker run -tid --net=host -p 9092:9092 --env broker_id=1 --env zookeeper_node=zookeeper --add-host \
800 zookeeper:192.168.121.111 opnfv/barometer-kafka
802 Run VES Application docker image
803 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
805 VES application uses configuration file ves_app_config.conf from directory
806 barometer/3rd_party/collectd-ves-app/ves_app/config/ and host.yaml file from
807 barometer/3rd_party/collectd-ves-app/ves_app/yaml/ by default. If you wish to use a custom config
808 file it should be mounted to mount point /opt/ves/config/ves_app_config.conf. To use an alternative yaml
809 file from folder barometer/3rd_party/collectd-ves-app/ves_app/yaml the name of the yaml file to use
810 should be passed as an additional command. If you wish to use a custom file the file should be
811 mounted to mount point /opt/ves/yaml/ Please see examples below
813 Run VES docker image with default configuration
817 $ sudo docker run -tid --net=host opnfv/barometer-ves
819 Run VES docker image with guest.yaml files from barometer/3rd_party/collectd-ves-app/ves_app/yaml/
823 $ sudo docker run -tid --net=host opnfv/barometer-ves guest.yaml
826 Run VES docker image with using custom config and yaml files. In example below yaml/ folder cotains
827 file named custom.yaml
831 $ sudo docker run -tid --net=host -v ${PWD}/custom.config:/opt/ves/config/ves_app_config.conf \
832 -v ${PWD}/yaml/:/opt/ves/yaml/ opnfv/barometer-ves custom.yaml
834 Build and Run LocalAgent and Redis Docker Images
835 -----------------------------------------------------
837 Download LocalAgent docker images
838 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
840 If you wish to use pre-built barometer project's LocalAgent images, you can pull the
841 images from https://hub.docker.com/r/opnfv/barometer-localagent/
844 If your preference is to build images locally please see sections `Build LocalAgent Docker Image`_
848 $ docker pull opnfv/barometer-localagent
851 If you have pulled the pre-built images there is no requirement to complete steps outlined
852 in sections `Build LocalAgent Docker Image`_ and you can proceed directly to section
853 `Run LocalAgent Docker Image`_ If you wish to run the docker images via Docker Compose proceed directly to section `Docker Compose`_.
855 Build LocalAgent docker image
856 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
858 Build LocalAgent docker image:
862 $ cd barometer/docker/barometer-dma
863 $ sudo docker build -t opnfv/barometer-dma --build-arg http_proxy=`echo $http_proxy` \
864 --build-arg https_proxy=`echo $https_proxy` -f Dockerfile .
867 In the above mentioned ``docker build`` command, http_proxy & https_proxy arguments needs
868 to be passed only if system is behind an HTTP or HTTPS proxy server.
870 Check the docker images:
876 Output should contain a barometer image:
880 REPOSITORY TAG IMAGE ID CREATED SIZE
881 opnfv/barometer-dma latest 2f14fbdbd498 3 hours ago 941 MB
883 Run Redis docker image
884 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
887 Before running LocalAgent, Redis must be running.
889 Run Redis docker image:
893 $ sudo docker run -tid -p 6379:6379 --name barometer-redis redis
895 Check your docker image is running
901 Run LocalAgent docker image
902 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
905 Run LocalAgent docker image with default configuration
909 $ cd barometer/docker/barometer-dma
910 $ sudo mkdir /etc/barometer-dma
911 $ sudo cp ../../src/dma/examples/config.toml /etc/barometer-dma/
912 $ sudo vi /etc/barometer-dma/config.toml
913 (edit amqp_password and os_password:OpenStack admin password)
916 (When there is no key for SSH access authentication)
918 (Press Enter until done)
919 (Backup if necessary)
920 # cp ~/.ssh/authorized_keys ~/.ssh/authorized_keys_org
921 # cat ~/.ssh/authorized_keys_org ~/.ssh/id_rsa.pub \
922 > ~/.ssh/authorized_keys
925 $ sudo docker run -tid --net=host --name server \
926 -v /etc/barometer-dma:/etc/barometer-dma \
927 -v /root/.ssh/id_rsa:/root/.ssh/id_rsa \
928 -v /etc/collectd/collectd.conf.d:/etc/collectd/collectd.conf.d \
929 opnfv/barometer-dma /server
931 $ sudo docker run -tid --net=host --name infofetch \
932 -v /etc/barometer-dma:/etc/barometer-dma \
933 -v /var/run/libvirt:/var/run/libvirt \
934 opnfv/barometer-dma /infofetch
936 (Execute when installing the threshold evaluation binary)
937 $ sudo docker cp infofetch:/threshold ./
938 $ sudo ln -s ${PWD}/threshold /usr/local/bin/
943 Install docker-compose
944 ^^^^^^^^^^^^^^^^^^^^^^
946 On the node where you want to run influxdb + grafana or the node where you want to run the VES app
947 zookeeper and Kafka containers together:
950 The default configuration for all these containers is to run on the localhost. If this is not
951 the model you want to use then please make the appropriate configuration changes before launching
952 the docker containers.
954 1. Start by installing docker compose
958 $ sudo curl -L https://github.com/docker/compose/releases/download/1.17.0/docker-compose-`uname -s`-`uname -m` -o /usr/bin/docker-compose
961 Use the latest Compose release number in the download command. The above command is an example,
962 and it may become out-of-date. To ensure you have the latest version, check the Compose repository
963 release page on GitHub.
965 2. Apply executable permissions to the binary:
969 $ sudo chmod +x /usr/bin/docker-compose
971 3. Test the installation.
975 $ sudo docker-compose --version
977 Run the InfluxDB and Grafana containers using docker compose
978 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
984 $ cd barometer/docker/compose/influxdb-grafana/
985 $ sudo docker-compose up -d
987 Check your docker images are running
993 Connect to <host_ip>:3000 with a browser and log into grafana: admin/admin
995 Run the Kafka, zookeeper and VES containers using docker compose
996 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1002 $ cd barometer/docker/compose/ves/
1003 $ sudo docker-compose up -d
1005 Check your docker images are running
1011 Testing the docker image
1012 ^^^^^^^^^^^^^^^^^^^^^^^^
1017 .. [1] https://docs.docker.com/engine/admin/systemd/#httphttps-proxy
1018 .. [2] https://docs.docker.com/engine/installation/linux/docker-ce/centos/#install-using-the-repository
1019 .. [3] https://docs.docker.com/engine/userguide/