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 Install 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 For an alternative installation method using ansible, please see the :ref:`Barometer One Click Install Guide <barometer-oneclick-userguide>`.
36 Barometer Docker Images Description
37 -----------------------------------
39 .. Describe the specific features and how it is realised in the scenario in a brief manner
40 .. to ensure the user understand the context for the user guide instructions to follow.
42 Barometer Collectd Image
43 ^^^^^^^^^^^^^^^^^^^^^^^^
44 The barometer collectd docker image gives you a collectd installation that includes all
45 the barometer plugins.
48 The Dockerfile is available in the docker/barometer-collectd directory in the barometer repo.
49 The Dockerfile builds a CentOS 7 docker image.
50 The container MUST be run as a privileged container.
52 Collectd is a daemon which collects system performance statistics periodically
53 and provides a variety of mechanisms to publish the collected metrics. It
54 supports more than 90 different input and output plugins. Input plugins
55 retrieve metrics and publish them to the collectd deamon, while output plugins
56 publish the data they receive to an end point. Collectd also has infrastructure
57 to support thresholding and notification.
59 Collectd docker image has enabled the following collectd plugins (in addition
60 to the standard collectd plugins):
63 * Open vSwitch events Plugin
64 * Open vSwitch stats Plugin
72 Plugins and third party applications in Barometer repository that will be available in the
75 * Open vSwitch PMD stats
76 * ONAP VES application
81 InfluxDB + Grafana Docker Images
82 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
84 The Barometer project's InfluxDB and Grafana docker images are 2 docker images that database and graph
85 statistics reported by the Barometer collectd docker. InfluxDB is an open-source time series database
86 tool which stores the data from collectd for future analysis via Grafana, which is a open-source
87 metrics anlytics and visualisation suite which can be accessed through any browser.
89 VES + Kafka Docker Images
90 ^^^^^^^^^^^^^^^^^^^^^^^^^
92 The Barometer project's VES application and Kafka docker images are based on a CentOS 7 image. Kafka
93 docker image has a dependancy on `Zookeeper <https://zookeeper.apache.org/>`_. Kafka must be able to
94 connect and register with an instance of Zookeeper that is either running on local or remote host.
95 Kafka recieves and stores metrics recieved from Collectd. VES application pulls latest metrics from Kafka
96 which it normalizes into VES format for sending to a VES collector. Please see details in
97 :ref:`VES Application User Guide <barometer-ves-userguide>`
101 .. Describe the specific capabilities and usage for <XYZ> feature.
102 .. Provide enough information that a user will be able to operate the feature on a deployed scenario.
105 The below sections provide steps for manual installation and configuration
106 of docker images. They are not neccessary if docker images were installed with
107 use of Ansible-Playbook.
112 * sudo permissions are required to install docker.
113 * These instructions are for Ubuntu 16.10
119 $ sudo apt-get install curl
120 $ sudo curl -fsSL https://get.docker.com/ | sh
121 $ sudo usermod -aG docker <username>
122 $ sudo systemctl status docker
124 Replace <username> above with an appropriate user name.
129 * sudo permissions are required to install docker.
130 * These instructions are for CentOS 7
136 $ sudo yum remove docker docker-common docker-selinux docker-engine
137 $ sudo yum install -y yum-utils device-mapper-persistent-data lvm2
138 $ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
139 $ sudo yum-config-manager --enable docker-ce-edge
140 $ sudo yum-config-manager --enable docker-ce-test
141 $ sudo yum install docker-ce
142 $ sudo usermod -aG docker <username>
143 $ sudo systemctl status docker
145 Replace <username> above with an appropriate user name.
148 If this is the first time you are installing a package from a recently added
149 repository, you will be prompted to accept the GPG key, and the key’s
150 fingerprint will be shown. Verify that the fingerprint is correct, and if so,
151 accept the key. The fingerprint should match060A 61C5 1B55 8A7F 742B 77AA C52F
154 Retrieving key from https://download.docker.com/linux/centos/gpg
155 Importing GPG key 0x621E9F35:
157 Userid : "Docker Release (CE rpm) <docker@docker.com>"
158 Fingerprint: 060a 61c5 1b55 8a7f 742b 77aa c52f eb6b 621e 9f35
159 From : https://download.docker.com/linux/centos/gpg
162 Manual proxy configuration for docker
163 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
166 This applies for both CentOS and Ubuntu.
168 If you are behind an HTTP or HTTPS proxy server, you will need to add this
169 configuration in the Docker systemd service file.
171 1. Create a systemd drop-in directory for the docker service:
175 $ sudo mkdir -p /etc/systemd/system/docker.service.d
178 called /etc/systemd/system/docker.service.d/http-proxy.conf that adds
179 the HTTP_PROXY environment variable:
184 Environment="HTTP_PROXY=http://proxy.example.com:80/"
186 Or, if you are behind an HTTPS proxy server, create a file
187 called /etc/systemd/system/docker.service.d/https-proxy.conf that adds
188 the HTTPS_PROXY environment variable:
193 Environment="HTTPS_PROXY=https://proxy.example.com:443/"
195 Or create a single file with all the proxy configurations:
196 /etc/systemd/system/docker.service.d/proxy.conf
201 Environment="HTTP_PROXY=http://proxy.example.com:80/"
202 Environment="HTTPS_PROXY=https://proxy.example.com:443/"
203 Environment="FTP_PROXY=ftp://proxy.example.com:443/"
204 Environment="NO_PROXY=localhost"
210 $ sudo systemctl daemon-reload
216 $ sudo systemctl restart docker
218 5. Check docker environment variables:
222 sudo systemctl show --property=Environment docker
224 Test docker installation
225 ^^^^^^^^^^^^^^^^^^^^^^^^
227 This applies for both CentOS and Ubuntu.
231 $ sudo docker run hello-world
233 The output should be something like:
237 Unable to find image 'hello-world:latest' locally
238 latest: Pulling from library/hello-world
239 5b0f327be733: Pull complete
240 Digest: sha256:07d5f7800dfe37b8c2196c7b1c524c33808ce2e0f74e7aa00e603295ca9a0972
241 Status: Downloaded newer image for hello-world:latest
244 This message shows that your installation appears to be working correctly.
246 To generate this message, Docker took the following steps:
247 1. The Docker client contacted the Docker daemon.
248 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
249 3. The Docker daemon created a new container from that image which runs the
250 executable that produces the output you are currently reading.
251 4. The Docker daemon streamed that output to the Docker client, which sent it
254 To try something more ambitious, you can run an Ubuntu container with:
258 $ docker run -it ubuntu bash
260 Build and Run Collectd Docker Image
261 -----------------------------------
263 Collectd-barometer flavors
264 ^^^^^^^^^^^^^^^^^^^^^^^^^^
266 Before starting to build and run the Collectd container, understand the available
267 flavors of Collectd containers:
268 * barometer-collectd - stable release, based on collectd 5.8
269 * barometer-collectd-master - release based on collectd 'master' branch
270 * barometer-collectd-experimental - release based on collectd 'master'
271 branch that also includes set of experimental(not yet merged into upstream)
275 Experimental container is not tested across various OS'es and the stability
276 of the container can change. Usage of experimental flavor is at users risk.
278 Stable barometer-collectd container is intended for work in production
279 environment as it is based on latest collectd official release.
280 `Barometer-collectd-master` and `barometer-collectd-experimental` containers
281 can be used in order to try new collectd features.
282 All flavors are located in `barometer` git repository - respective dockerfiles
283 are stored in subdirectories of 'docker/' directory
288 $ git clone https://gerrit.opnfv.org/gerrit/barometer
289 $ ls barometer/docker|grep collectd
291 barometer-collectd-master
292 barometer-collectd-experimental
295 Main directory of barometer source code (directory that contains 'docker',
296 'docs', 'src' and systems sub-directories) will be referred as
297 ``<BAROMETER_REPO_DIR>``
299 Download the collectd docker image
300 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
301 If you wish to use a pre-built barometer image, you can pull the barometer
302 image from https://hub.docker.com/r/opnfv/barometer-collectd/
306 $ docker pull opnfv/barometer-collectd
308 Build stable collectd container
309 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
313 $ cd <BAROMETER_REPO_DIR>/docker/barometer-collectd
314 $ sudo docker build -t opnfv/barometer-collectd --build-arg http_proxy=`echo $http_proxy` \
315 --build-arg https_proxy=`echo $https_proxy` --network=host -f Dockerfile .
318 In the above mentioned ``docker build`` command, http_proxy & https_proxy arguments needs to be
319 passed only if system is behind an HTTP or HTTPS proxy server.
321 Check the docker images:
327 Output should contain a barometer-collectd image:
331 REPOSITORY TAG IMAGE ID CREATED SIZE
332 opnfv/barometer-collectd latest 05f2a3edd96b 3 hours ago 1.2GB
333 centos 7 196e0ce0c9fb 4 weeks ago 197MB
334 centos latest 196e0ce0c9fb 4 weeks ago 197MB
335 hello-world latest 05a3bd381fc2 4 weeks ago 1.84kB
338 If you do not plan to use collectd-master and collectd-experimental barometer
339 containers, then you can proceed directly to section `Run the collectd stable docker image`_
342 Build collectd-master container
343 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
347 $ cd <BAROMETER_REPO_DIR>
348 $ sudo docker build -t opnfv/barometer-collectd-master \
349 --build-arg http_proxy=`echo $http_proxy` \
350 --build-arg https_proxy=`echo $https_proxy` --network=host -f \
351 docker/barometer-collectd-master/Dockerfile .
354 For `barometer-collectd-master` and `barometer-collectd-experimental` containers
355 proxy parameters should be passed only if system is behind an HTTP or HTTPS
356 proxy server (same as for stable collectd container)
358 Build collectd-experimental container
359 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
363 $ cd <BAROMETER_REPO_DIR>
364 $ sudo docker build -t opnfv/barometer-collectd-experimental \
365 --build-arg http_proxy=`echo $http_proxy` \
366 --build-arg https_proxy=`echo $https_proxy` \
367 --network=host -f docker/barometer-collectd-experimental/Dockerfile .
370 For `barometer-collectd-master` and `barometer-collectd-experimental` containers
371 proxy parameters should be passed only if system is behind an HTTP or HTTPS
372 proxy server (same as for stable collectd container)
374 Run the collectd stable docker image
375 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
378 $ cd <BAROMETER_REPO_DIR>
379 $ sudo docker run -ti --net=host -v \
380 `pwd`/src/collectd/collectd_sample_configs:/opt/collectd/etc/collectd.conf.d \
381 -v /var/run:/var/run -v /tmp:/tmp -v /sys/fs/resctrl:/sys/fs/resctrl \
382 --privileged opnfv/barometer-collectd
385 The docker collectd image contains configuration for all the collectd
386 plugins. In the command above we are overriding
387 /opt/collectd/etc/collectd.conf.d by mounting a host directory
388 src/collectd/collectd_sample_configs that contains only the sample
389 configurations we are interested in running.
391 *If some dependencies for plugins listed in configuration directory
392 aren't met, then collectd startup may fail(collectd tries to
393 initialize plugins configurations for all given config files that can
394 be found in shared configs directory and may fail if some dependency
397 If `DPDK` or `RDT` can't be installed on host, then corresponding config
398 files should be removed from shared configuration directory
399 (`<BAROMETER_REPO_DIR>/src/collectd/collectd_sample_configs/`) prior
400 to starting barometer-collectd container. By example: in case of missing
401 `DPDK` functionality on the host, `dpdkstat.conf` and `dpdkevents.conf`
404 Sample configurations can be found at:
405 https://github.com/opnfv/barometer/tree/master/src/collectd/collectd_sample_configs
407 List of barometer-collectd dependencies on host for various plugins
409 https://wiki.opnfv.org/display/fastpath/Barometer-collectd+host+dependencies
411 The Resource Control file system (/sys/fs/resctrl) can be bound from host to
412 container only if this directory exists on the host system. Otherwise omit
413 the '-v /sys/fs/resctrl:/sys/fs/resctrl' part in docker run command.
414 More information about resctrl can be found at:
415 https://github.com/intel/intel-cmt-cat/wiki/resctrl
417 Check your docker image is running
423 To make some changes when the container is running run:
427 sudo docker exec -ti <CONTAINER ID> /bin/bash
429 Run the barometer-collectd-master docker image
430 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
431 Run command for `barometer-collectd-master` container is very similar to command
432 used for stable container - the only differences are name of the image
433 and location of the sample configuration files(as different version of collectd
434 plugins requiring different configuration files)
439 $ cd <BAROMETER_REPO_DIR>
440 $ sudo docker run -ti --net=host -v \
441 `pwd`/src/collectd/collectd_sample_configs-master:/opt/collectd/etc/collectd.conf.d \
442 -v /var/run:/var/run -v /tmp:/tmp -v /sys/fs/resctrl:/sys/fs/resctrl \
443 --privileged opnfv/barometer-collectd-master
446 Barometer collectd docker images are sharing some directories with host
447 (e.g. /tmp) therefore only one of collectd barometer flavors can be run
448 at a time. In other words, if you want to try `barometer-collectd-master` or
449 `barometer-collectd-experimental` image, please stop instance of
450 `barometer-collectd(stable)` image first.
452 The Resource Control file system (/sys/fs/resctrl) can be bound from host to
453 container only if this directory exists on the host system. Otherwise omit
454 the '-v /sys/fs/resctrl:/sys/fs/resctrl' part in docker run command.
455 More information about resctrl can be found at:
456 https://github.com/intel/intel-cmt-cat/wiki/resctrl
458 Run the barometer-collectd-experimental docker image
459 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
460 Barometer-collectd-experimental container shares default configuration files
461 with 'barometer-collectd-master' equivalent but some of experimental pull
462 requests may require modified configuration. Additional configuration files that
463 are required specifically by experimental container can be found in
464 `docker/barometer-collectd-experimental/experimental-configs/`
465 directory. Content of this directory (all \*.conf files) should be copied to
466 `src/collectd/collectd_sample_configs-master` directory before first run of
467 experimental container.
471 $ cd <BAROMETER_REPO_DIR>
472 $ cp docker/barometer-collectd-experimental/experimental-configs/*.conf \
473 src/collectd/collectd_sample_configs-master
475 When configuration files are up to date for experimental container, it can be
476 launched using following command (almost identical to run-command for 'master'
481 $ cd <BAROMETER_REPO_DIR>
482 $ sudo docker run -ti --net=host -v \
483 `pwd`/src/collectd/collectd_sample_configs-master:/opt/collectd/etc/collectd.conf.d \
484 -v /var/run:/var/run -v /tmp:/tmp -v /sys/fs/resctrl:/sys/fs/resctrl --privileged \
485 opnfv/barometer-collectd-experimental
488 The Resource Control file system (/sys/fs/resctrl) can be bound from host to
489 container only if this directory exists on the host system. Otherwise omit
490 the '-v /sys/fs/resctrl:/sys/fs/resctrl' part in docker run command.
491 More information about resctrl can be found at:
492 https://github.com/intel/intel-cmt-cat/wiki/resctrl
495 Build and Run InfluxDB and Grafana docker images
496 ------------------------------------------------
500 The barometer-influxdb image is based on the influxdb:1.3.7 image from the influxdb dockerhub. To
501 view detils on the base image please visit
502 `https://hub.docker.com/_/influxdb/ <https://hub.docker.com/_/influxdb/>`_ Page includes details of
503 exposed ports and configurable enviromental variables of the base image.
505 The barometer-grafana image is based on grafana:4.6.3 image from the grafana dockerhub. To view
506 details on the base image please visit
507 `https://hub.docker.com/r/grafana/grafana/ <https://hub.docker.com/r/grafana/grafana/>`_ Page
508 includes details on exposed ports and configurable enviromental variables of the base image.
510 The barometer-grafana image includes pre-configured source and dashboards to display statistics exposed
511 by the barometer-collectd image. The default datasource is an influxdb database running on localhost
512 but the address of the influxdb server can be modified when launching the image by setting the
513 environmental variables influxdb_host to IP or hostname of host on which influxdb server is running.
515 Additional dashboards can be added to barometer-grafana by mapping a volume to /opt/grafana/dashboards.
516 Incase where a folder is mounted to this volume only files included in this folder will be visible
517 inside barometer-grafana. To ensure all default files are also loaded please ensure they are included in
518 volume folder been mounted. Appropriate example are given in section `Run the Grafana docker image`_
520 Download the InfluxDB and Grafana docker images
521 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
522 If you wish to use pre-built barometer project's influxdb and grafana images, you can pull the
523 images from https://hub.docker.com/r/opnfv/barometer-influxdb/ and https://hub.docker.com/r/opnfv/barometer-grafana/
526 If your preference is to build images locally please see sections `Build InfluxDB Docker Image`_ and
527 `Build Grafana Docker Image`_
531 $ docker pull opnfv/barometer-influxdb
532 $ docker pull opnfv/barometer-grafana
535 If you have pulled the pre-built barometer-influxdb and barometer-grafana images there is no
536 requirement to complete steps outlined in sections `Build InfluxDB Docker Image`_ and
537 `Build Grafana Docker Image`_ and you can proceed directly to section
538 `Run the Influxdb and Grafana Images`_
540 Build InfluxDB docker image
541 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
543 Build influxdb image from Dockerfile
547 $ cd barometer/docker/barometer-influxdb
548 $ sudo docker build -t opnfv/barometer-influxdb --build-arg http_proxy=`echo $http_proxy` \
549 --build-arg https_proxy=`echo $https_proxy` --network=host -f Dockerfile .
552 In the above mentioned ``docker build`` command, http_proxy & https_proxy arguments needs to
553 be passed only if system is behind an HTTP or HTTPS proxy server.
555 Check the docker images:
561 Output should contain an influxdb image:
565 REPOSITORY TAG IMAGE ID CREATED SIZE
566 opnfv/barometer-influxdb latest 1e4623a59fe5 3 days ago 191MB
568 Build Grafana docker image
569 ^^^^^^^^^^^^^^^^^^^^^^^^^^
571 Build Grafana image from Dockerfile
575 $ cd barometer/docker/barometer-grafana
576 $ sudo docker build -t opnfv/barometer-grafana --build-arg http_proxy=`echo $http_proxy` \
577 --build-arg https_proxy=`echo $https_proxy` -f Dockerfile .
580 In the above mentioned ``docker build`` command, http_proxy & https_proxy arguments needs to
581 be passed only if system is behind an HTTP or HTTPS proxy server.
583 Check the docker images:
589 Output should contain an influxdb image:
593 REPOSITORY TAG IMAGE ID CREATED SIZE
594 opnfv/barometer-grafana latest 05f2a3edd96b 3 hours ago 1.2GB
596 Run the Influxdb and Grafana Images
597 -----------------------------------
599 Run the InfluxDB docker image
600 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
603 $ sudo docker run -tid -v /var/lib/influxdb:/var/lib/influxdb --net=host\
604 --name bar-influxdb opnfv/barometer-influxdb
606 Check your docker image is running
612 To make some changes when the container is running run:
616 sudo docker exec -ti <CONTAINER ID> /bin/bash
618 When both collectd and InfluxDB containers are located
619 on the same host, then no additional configuration have to be added and you
620 can proceed directly to `Run the Grafana docker image`_ section.
622 Modify collectd to support InfluxDB on another host
623 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
624 If InfluxDB and collectd containers are located on separate hosts, then
625 additional configuration have to be done in ``collectd`` container - it
626 normally sends data using network plugin to 'localhost/127.0.0.1' therefore
627 changing output location is required:
629 1. Stop and remove running bar-collectd container (if it is running)
633 $ sudo docker ps #to get collectd container name
634 $ sudo docker rm -f <COLLECTD_CONTAINER_NAME>
636 2. Go to location where shared collectd config files are stored
640 $ cd <BAROMETER_REPO_DIR>
641 $ cd src/collectd/collectd_sample_configs
643 3. Edit content of ``network.conf`` file.
644 By default this file looks like that:
650 Server "127.0.0.1" "25826"
653 ``127.0.0.1`` string has to be replaced with the IP address of host where
654 InfluxDB container is running (e.g. ``192.168.121.111``). Edit this using your
655 favorite text editor.
657 4. Start again collectd container like it is described in
658 `Run the collectd stable docker image`_ chapter
662 $ cd <BAROMETER_REPO_DIR>
663 $ sudo docker run -ti --name bar-collectd --net=host -v \
664 `pwd`/src/collectd/collectd_sample_configs:/opt/collectd/etc/collectd.conf.d \
665 -v /var/run:/var/run -v /tmp:/tmp --privileged opnfv/barometer-collectd
667 Now collectd container will be sending data to InfluxDB container located on
668 remote Host pointed by IP configured in step 3.
670 Run the Grafana docker image
671 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
673 Connecting to an influxdb instance running on local system and adding own custom dashboards
677 $ cd <BAROMETER_REPO_DIR>
678 $ sudo docker run -tid -v /var/lib/grafana:/var/lib/grafana \
679 -v ${PWD}/docker/barometer-grafana/dashboards:/opt/grafana/dashboards \
680 --name bar-grafana --net=host opnfv/barometer-grafana
682 Connecting to an influxdb instance running on remote system with hostname of someserver and IP address
687 $ sudo docker run -tid -v /var/lib/grafana:/var/lib/grafana --net=host -e \
688 influxdb_host=someserver --add-host someserver:192.168.121.111 --name \
689 bar-grafana opnfv/barometer-grafana
691 Check your docker image is running
697 To make some changes when the container is running run:
701 sudo docker exec -ti <CONTAINER ID> /bin/bash
703 Connect to <host_ip>:3000 with a browser and log into grafana: admin/admin
705 Cleanup of influxdb/grafana configuration
706 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
708 When user wants to remove current grafana and influxdb configuration,
709 folowing actions have to be performed
711 1. Stop and remove running influxdb and grafana containers
715 sudo docker rm -f bar-grafana bar-influxdb
717 2. Remove shared influxdb and grafana folders from the Host
721 sudo rm -rf /var/lib/grafana
722 sudo rm -rf /var/lib/influxdb
725 Shared folders are storing configuration of grafana and influxdb
726 containers. In case of changing influxdb or grafana configuration
727 (e.g. moving influxdb to another host) it is good to perform cleanup
728 on shared folders to not affect new setup with an old configuration.
730 Build and Run VES and Kafka Docker Images
731 -----------------------------------------
733 Download VES and Kafka docker images
734 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
736 If you wish to use pre-built barometer project's VES and kafka images, you can pull the
737 images from https://hub.docker.com/r/opnfv/barometer-ves/ and https://hub.docker.com/r/opnfv/barometer-kafka/
740 If your preference is to build images locally please see sections `Build the Kafka Image`_ and
745 $ docker pull opnfv/barometer-kafka
746 $ docker pull opnfv/barometer-ves
749 If you have pulled the pre-built images there is no requirement to complete steps outlined
750 in sections `Build Kafka Docker Image`_ and `Build VES Docker Image`_ and you can proceed directly to section
751 `Run Kafka Docker Image`_
753 Build Kafka docker image
754 ^^^^^^^^^^^^^^^^^^^^^^^^
756 Build Kafka docker image:
760 $ cd barometer/docker/barometer-kafka
761 $ sudo docker build -t opnfv/barometer-kafka --build-arg http_proxy=`echo $http_proxy` \
762 --build-arg https_proxy=`echo $https_proxy` -f Dockerfile .
765 In the above mentioned ``docker build`` command, http_proxy & https_proxy arguments needs
766 to be passed only if system is behind an HTTP or HTTPS proxy server.
768 Check the docker images:
774 Output should contain a barometer image:
778 REPOSITORY TAG IMAGE ID CREATED SIZE
779 opnfv/barometer-kafka latest 05f2a3edd96b 3 hours ago 1.2GB
781 Build VES docker image
782 ^^^^^^^^^^^^^^^^^^^^^^
784 Build VES application docker image:
788 $ cd barometer/docker/barometer-ves
789 $ sudo docker build -t opnfv/barometer-ves --build-arg http_proxy=`echo $http_proxy` \
790 --build-arg https_proxy=`echo $https_proxy` -f Dockerfile .
793 In the above mentioned ``docker build`` command, http_proxy & https_proxy arguments needs
794 to be passed only if system is behind an HTTP or HTTPS proxy server.
796 Check the docker images:
802 Output should contain a barometer image:
806 REPOSITORY TAG IMAGE ID CREATED SIZE
807 opnfv/barometer-ves latest 05f2a3edd96b 3 hours ago 1.2GB
809 Run Kafka docker image
810 ^^^^^^^^^^^^^^^^^^^^^^
813 Before running Kafka an instance of Zookeeper must be running for the Kafka broker to register
814 with. Zookeeper can be running locally or on a remote platform. Kafka's broker_id and address of
815 its zookeeper instance can be configured by setting values for environmental variables 'broker_id'
816 and 'zookeeper_node'. In instance where 'broker_id' and/or 'zookeeper_node' is not set the default
817 setting of broker_id=0 and zookeeper_node=localhost is used. In intance where Zookeeper is running
818 on same node as Kafka and there is a one to one relationship between Zookeeper and Kafka, default
819 setting can be used. The docker argument `add-host` adds hostname and IP address to
820 /etc/hosts file in container
822 Run zookeeper docker image:
826 $ sudo docker run -tid --net=host -p 2181:2181 zookeeper:3.4.11
828 Run kafka docker image which connects with a zookeeper instance running on same node with a 1:1 relationship
832 $ sudo docker run -tid --net=host -p 9092:9092 opnfv/barometer-kafka
835 Run kafka docker image which connects with a zookeeper instance running on a node with IP address of
836 192.168.121.111 using broker ID of 1
840 $ sudo docker run -tid --net=host -p 9092:9092 --env broker_id=1 --env zookeeper_node=zookeeper --add-host \
841 zookeeper:192.168.121.111 opnfv/barometer-kafka
843 Run VES Application docker image
844 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
846 VES application uses configuration file ves_app_config.conf from directory
847 barometer/3rd_party/collectd-ves-app/ves_app/config/ and host.yaml file from
848 barometer/3rd_party/collectd-ves-app/ves_app/yaml/ by default. If you wish to use a custom config
849 file it should be mounted to mount point /opt/ves/config/ves_app_config.conf. To use an alternative yaml
850 file from folder barometer/3rd_party/collectd-ves-app/ves_app/yaml the name of the yaml file to use
851 should be passed as an additional command. If you wish to use a custom file the file should be
852 mounted to mount point /opt/ves/yaml/ Please see examples below
854 Run VES docker image with default configuration
858 $ sudo docker run -tid --net=host opnfv/barometer-ves
860 Run VES docker image with guest.yaml files from barometer/3rd_party/collectd-ves-app/ves_app/yaml/
864 $ sudo docker run -tid --net=host opnfv/barometer-ves guest.yaml
867 Run VES docker image with using custom config and yaml files. In example below yaml/ folder cotains
868 file named custom.yaml
872 $ sudo docker run -tid --net=host -v ${PWD}/custom.config:/opt/ves/config/ves_app_config.conf \
873 -v ${PWD}/yaml/:/opt/ves/yaml/ opnfv/barometer-ves custom.yaml
875 Run VES Test Collector application
876 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
878 VES Test Collector application can be used for displaying platform
879 wide metrics that are collected by barometer-ves container.
880 Setup instructions are located in: :ref:`Setup VES Test Collector`
882 Build and Run DMA and Redis Docker Images
883 -----------------------------------------
885 Download DMA docker images
886 ^^^^^^^^^^^^^^^^^^^^^^^^^^
888 If you wish to use pre-built barometer project's DMA images, you can pull the
889 images from https://hub.docker.com/r/opnfv/barometer-dma/
892 If your preference is to build images locally please see sections `Build DMA Docker Image`_
896 $ docker pull opnfv/barometer-dma
899 If you have pulled the pre-built images there is no requirement to complete steps outlined
900 in sections `Build DMA Docker Image`_ and you can proceed directly to section
901 `Run DMA Docker Image`_
903 Build DMA docker image
904 ^^^^^^^^^^^^^^^^^^^^^^
906 Build DMA docker image:
910 $ cd barometer/docker/barometer-dma
911 $ sudo docker build -t opnfv/barometer-dma --build-arg http_proxy=`echo $http_proxy` \
912 --build-arg https_proxy=`echo $https_proxy` -f Dockerfile .
915 In the above mentioned ``docker build`` command, http_proxy & https_proxy arguments needs
916 to be passed only if system is behind an HTTP or HTTPS proxy server.
918 Check the docker images:
924 Output should contain a barometer image:
928 REPOSITORY TAG IMAGE ID CREATED SIZE
929 opnfv/barometer-dma latest 2f14fbdbd498 3 hours ago 941 MB
931 Run Redis docker image
932 ^^^^^^^^^^^^^^^^^^^^^^
935 Before running DMA, Redis must be running.
937 Run Redis docker image:
941 $ sudo docker run -tid -p 6379:6379 --name barometer-redis redis
943 Check your docker image is running
953 Run DMA docker image with default configuration
957 $ cd barometer/docker/barometer-dma
958 $ sudo mkdir /etc/barometer-dma
959 $ sudo cp ../../src/dma/examples/config.toml /etc/barometer-dma/
960 $ sudo vi /etc/barometer-dma/config.toml
961 (edit amqp_password and os_password:OpenStack admin password)
964 (When there is no key for SSH access authentication)
966 (Press Enter until done)
967 (Backup if necessary)
968 # cp ~/.ssh/authorized_keys ~/.ssh/authorized_keys_org
969 # cat ~/.ssh/authorized_keys_org ~/.ssh/id_rsa.pub \
970 > ~/.ssh/authorized_keys
973 $ sudo docker run -tid --net=host --name server \
974 -v /etc/barometer-dma:/etc/barometer-dma \
975 -v /root/.ssh/id_rsa:/root/.ssh/id_rsa \
976 -v /etc/collectd/collectd.conf.d:/etc/collectd/collectd.conf.d \
977 opnfv/barometer-dma /server
979 $ sudo docker run -tid --net=host --name infofetch \
980 -v /etc/barometer-dma:/etc/barometer-dma \
981 -v /var/run/libvirt:/var/run/libvirt \
982 opnfv/barometer-dma /infofetch
984 (Execute when installing the threshold evaluation binary)
985 $ sudo docker cp infofetch:/threshold ./
986 $ sudo ln -s ${PWD}/threshold /usr/local/bin/
990 .. [1] https://docs.docker.com/config/daemon/systemd/#httphttps-proxy
991 .. [2] https://docs.docker.com/engine/install/centos/#install-using-the-repository
992 .. [3] https://docs.docker.com/engine/userguide/