docker.userguide: Add a note about bar-collectd run without DPDK/RDT
[barometer.git] / docs / release / userguide / docker.userguide.rst
index cc82e78..15acf38 100644 (file)
@@ -94,8 +94,68 @@ Kafka recieves and stores metrics recieved from Collectd. VES application pulls
 which it normalizes into VES format for sending to a VES collector. Please see details in 
 :ref:`VES Application User Guide <barometer-ves-userguide>`
 
-Download and Run Docker Images with Ansible-Playbook
-----------------------------------------------------
+One Click Install with Ansible
+------------------------------
+
+Proxy for package manager on host
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. note::
+   This step has to be performed only if host is behind HTTP/HTTPS proxy
+
+Proxy URL have to be set in dedicated config file
+
+1. CentOS - /etc/yum.conf
+
+.. code:: bash
+
+    proxy=http://your.proxy.domain:1234
+
+2. Ubuntu - /etc/apt/apt.conf
+
+.. code:: bash
+
+    Acquire::http::Proxy "http://your.proxy.domain:1234"
+
+After update of config file, apt mirrors have to be updated via 'apt-get update'
+
+.. code:: bash
+
+    $ sudo apt-get update
+
+Proxy environment variables(for docker and pip)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. note::
+   This step has to be performed only if host is behind HTTP/HTTPS proxy
+
+Configuring proxy for packaging system is not enough, also some proxy
+environment variables have to be set in the system before ansible scripts
+can be started.
+Barometer configures docker proxy automatically via ansible task as a part
+of 'one click install' process - user only has to provide proxy URL using common
+shell environment variables and ansible will automatically configure proxies
+for docker(to be able to fetch barometer images). Another component used by
+ansible (e.g. pip is used for downloading python dependencies) will also benefit
+from setting proxy variables properly in the system.
+
+Proxy variables used by ansible One Click Install:
+   * http_proxy
+   * https_proxy
+   * ftp_proxy
+   * no_proxy
+
+Variables mentioned above have to be visible for superuser (because most
+actions involving ansible-barometer installation require root privileges).
+Proxy variables are commonly defined in '/etc/environment' file (but any other
+place is good as long as variables can be seen by commands using 'su').
+
+Sample proxy configuration in /etc/environment:
+
+.. code:: bash
+
+    http_proxy=http://your.proxy.domain:1234
+    https_proxy=http://your.proxy.domain:1234
+    ftp_proxy=http://your.proxy.domain:1234
+    no_proxy=localhost
 
 Install Ansible
 ^^^^^^^^^^^^^^^
@@ -103,6 +163,7 @@ Install Ansible
    * sudo permissions or root access are required to install ansible.
    * ansible version needs to be 2.4+, because usage of import/include statements
 
+The following steps have been verified with Ansible 2.6.3 on Ubuntu 16.04 and 18.04.
 To install Ansible 2.6.3 on Ubuntu:
 
 .. code:: bash
@@ -111,6 +172,7 @@ To install Ansible 2.6.3 on Ubuntu:
     $ sudo apt-get install python-pip
     $ sudo pip install 'ansible==2.6.3'
 
+The following steps have been verified with Ansible 2.6.3 on Centos 7.5.
 To install Ansible 2.6.3 on Centos:
 
 .. code:: bash
@@ -130,7 +192,7 @@ Clone barometer repo
 
 Edit inventory file
 ^^^^^^^^^^^^^^^^^^^
-Edit inventory file and add hosts: ~/default.inv
+Edit inventory file and add hosts: $barometer_dir/docker/ansible/default.inv
 
 .. code:: bash
 
@@ -177,6 +239,12 @@ and insert_ipmi_modules, both variables are independent:
     install_mcelog=false
     insert_ipmi_modules=false
 
+.. note::
+   On Ubuntu 18.04 to use mcelog plugin the user has to install mcelog daemon
+   manually ahead of installing from ansible scripts as the deb package is not
+   available in official Ubuntu 18.04 repo. It means that setting install_mcelog
+   to true is ignored.
+
 Configure ssh keys
 ^^^^^^^^^^^^^^^^^^
 
@@ -186,18 +254,34 @@ Generate ssh keys if not present, otherwise move onto next step.
 
     $ sudo ssh-keygen
 
-Coppy ssh key to all target hosts. It requires to provide root password. The example is for localhost.
+Copy ssh key to all target hosts. It requires to provide root password.
+The example is for localhost.
 
 .. code:: bash
 
     $ sudo ssh-copy-id root@localhost
 
-Download collectd+influxdb+grafana containers
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Verify that key is added and password is not required to connect.
 
 .. code:: bash
 
-    $ sudo ansible-playbook -i ~/default.inv collectd_service.yml
+    $ sudo ssh root@localhost
+
+.. note::
+   Keys should be added to every target host and [localhost] is only used as an
+   example. For multinode installation keys need to be copied for each node:
+   [collectd_hostname], [influxdb_hostname] etc.
+
+Download and run Collectd+Influxdb+Grafana containers
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The One Click installation features easy and scalable deployment of Collectd,
+Influxdb and Grafana containers using Ansible playbook. The following steps goes
+through more details.
+
+.. code:: bash
+
+    $ sudo ansible-playbook -i default.inv collectd_service.yml
 
 Check the three containers are running, the output of docker ps should be similar to:
 
@@ -215,7 +299,9 @@ To make some changes when a container is running run:
 
     $ sudo docker exec -ti <CONTAINER ID> /bin/bash
 
-Connect to <host_ip>:3000 with a browser and log into grafana: admin/admin
+Connect to <host_ip>:3000 with a browser and log into Grafana: admin/admin.
+For short introduction please see the:
+`Grafana guide <http://docs.grafana.org/guides/getting_started/>`_.
 
 The collectd configuration files can be accessed directly on target system in '/opt/collectd/etc/collectd.conf.d'.
 It can be used for manual changes or enable/disable plugins. If configuration has been modified it is required to
@@ -233,7 +319,7 @@ The 'zookeeper_hostname' and 'broker_id' can be set in ./roles/run_kafka/vars/ma
 
 .. code:: bash
 
-    $ sudo ansible-playbook -i ~/default.inv collectd_ves.yml
+    $ sudo ansible-playbook -i default.inv collectd_ves.yml
 
 Check the three containers are running, the output of docker ps should be similar to:
 
@@ -273,13 +359,13 @@ To run a specific parts only:
 
 .. code:: bash
 
-    $ sudo ansible-playbook -i ~/default.inv collectd_service.yml --tags "syslog,cpu,uuid"
+    $ sudo ansible-playbook -i default.inv collectd_service.yml --tags "syslog,cpu,uuid"
 
 To disable some parts or plugins:
 
 .. code:: bash
 
-    $ sudo ansible-playbook -i ~/default.inv collectd_service.yml --skip-tags "en_default_all,syslog,cpu,uuid"
+    $ sudo ansible-playbook -i default.inv collectd_service.yml --skip-tags "en_default_all,syslog,cpu,uuid"
 
 List of available tags:
 
@@ -311,6 +397,11 @@ Installing Docker
 .. Describe the specific capabilities and usage for <XYZ> feature.
 .. Provide enough information that a user will be able to operate the feature on a deployed scenario.
 
+.. note::
+   The below sections provide steps for manual installation and configuration
+   of docker images. They are not neccessary if docker images were installed with
+   use of Ansible-Playbook.
+
 On Ubuntu
 ^^^^^^^^^^
 .. note::
@@ -363,8 +454,9 @@ Replace <username> above with an appropriate user name.
          From       : https://download.docker.com/linux/centos/gpg
         Is this ok [y/N]: y
 
-Proxy Configuration:
-^^^^^^^^^^^^^^^^^^^^
+Manual proxy configuration for docker
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
 .. note::
    This applies for both CentOS and Ubuntu.
 
@@ -522,11 +614,28 @@ Run the collectd docker image
    plugins. In the command above we are overriding
    /opt/collectd/etc/collectd.conf.d by mounting a host directory
    src/collectd/collectd_sample_configs that contains only the sample
-   configurations we are interested in running. *It's important to do
-   this if you don't have DPDK, or RDT installed on the host*.
+   configurations we are interested in running.
+
+   *If some dependencies for plugins listed in configuration directory
+   aren't met, then collectd startup may fail(collectd tries to
+   initialize plugins configurations for all given config files that can
+   be found in shared configs directory and may fail if some dependency
+   is missing).*
+
+   If `DPDK` or `RDT` can't be installed on host, then corresponding config
+   files should be removed from shared configuration directory
+   (`<BAROMETER_REPO_DIR>/src/collectd/collectd_sample_configs/`) prior
+   to starting barometer-collectd container. By example: in case of missing
+   `DPDK` functionality on the host, `dpdkstat.conf` and `dpdkevents.conf`
+   should be removed.
+
    Sample configurations can be found at:
    https://github.com/opnfv/barometer/tree/master/src/collectd/collectd_sample_configs
 
+   List of barometer-collectd dependencies on host for various plugins
+   can be found at:
+   https://wiki.opnfv.org/display/fastpath/Barometer-collectd+host+dependencies
+
 Check your docker image is running
 
 .. code:: bash