Merge "Enable write_redis plugin for barometer-collectd"
[barometer.git] / docker / barometer-collectd / README
1 ==============================================================================
2 Readme for collectd docker container in barometer project
3 ==============================================================================
4
5 This text file includes information about environment preparation and
6 deployment collectd in docker container
7
8 Table of content:
9 1. DESCRIPTION
10 2. SYSTEM REQUIREMENTS
11 3. INSTALLATION NOTES
12 4. ADDITIONAL STEPS
13
14 ------------------------------------------------------------------------------
15 1. DESCRIPTION
16
17 This Dockerfile provides instruction for building collect in isolated container
18
19 ------------------------------------------------------------------------------
20 2. SYSTEM REQUIREMENTS
21
22   Docker >= 17.06.0-ce
23
24 ------------------------------------------------------------------------------
25 3. INSTALLATION NOTES
26
27 To build docker container run
28 sudo docker build -f ./docker/barometer-collectd/Dockerfile .
29 from barometer folder.
30
31 To run builded image run
32 sudo docker images
33 Get docker image id
34 sudo docker run -ti --net=host -v `pwd`/../src/collectd_sample_configs:/opt/collectd/etc/collectd.d \
35 -v /var/run:/var/run -v /tmp:/tmp --privileged <image id> /run_collectd.sh
36
37 To make some changes run
38 sudo docker run -ti --net=host -v `pwd`/../collectd_sample_configs:/opt/collectd/etc/collectd.d \
39  -v /var/run:/var/run --privileged <image id> /bin/bash
40
41 /opt/collectd/sbin/collectd -f
42
43 ------------------------------------------------------------------------------
44 4. ADDITIONAL STEPS
45
46 To check if container works properly additional packages should be installed
47 on host system.
48
49 MCELOG
50 To simulate mcelog message use instruction in http://artifacts.opnfv.org/barometer/docs/index.html#mcelog-plugin
51
52 git clone https://github.com/andikleen/mce-inject
53 cd mce-inject/
54 make
55 sudo make install
56 modprobe mce-inject
57
58 go to mcelog folder
59 sudo make test
60
61 if runs multiple times mcelog service shoud be restarted(cause mcelog make test exits closes mcelog)
62
63 VIRT
64 http://artifacts.opnfv.org/barometer/docs/index.html#virt-plugin
65 Check that libvirtd is running on the remote host
66 systemctl status libvirtd
67 virsh list
68 virsh perf instance-00000003
69 sudo virsh perf instance-00000003 --enable cpu_cycles --live
70 sudo virsh perf instance-00000003 --enable cmt --live
71 sudo virsh perf instance-00000003 --enable mbmt --live
72 sudo virsh perf instance-00000003 --enable mbml --live
73 sudo virsh perf instance-00000003 --enable instructions --live
74 sudo virsh perf instance-00000003 --enable cache_references --live
75 sudo virsh perf instance-00000003 --enable cache_mises --live
76 sudo virsh perf instance-00000003 --enable cache_misses --live
77
78 OVS
79 To successfuly run ovs plugins in Docker you need an ovs instance to connect to
80
81 sudo yum install -y openvswitch-switch
82 sudo service openvswitch-switch start
83 sudo ovs-vsctl set-manager ptcp:6640
84
85 Alternatively you can build ovs from source
86 yum -y install make gcc openssl-devel autoconf automake rpm-build \
87        redhat-rpm-config python-devel openssl-devel kernel-devel  \
88        kernel-debug-devel libtool wget python-six selinux-policy-devel
89 mkdir -p ~/rpmbuild/SOURCES
90 cd ~/rpmbuild/SOURCES
91 wget http://openvswitch.org/releases/openvswitch-2.5.3.tar.gz
92 tar xfz openvswitch-2.5.3.tar.gz
93 sed 's/openvswitch-kmod, //g' rhel/openvswitch.spec > rhel/openvswitch_no_kmod.spec
94 rpmbuild -bb --nocheck rhel/openvswitch_no_kmod.spec
95 cd ../RPMS/x86_64/
96 yum install -y openvswitch-2.5.3-1.x86_64.rpm
97 sudo systemctl start openvswitch.service
98 sudo ovs-vsctl set-manager ptcp:6640
99
100 To check if connection is successfull please check
101 sudo ovs-vsctl show
102 319efc53-b321-49a9-b628-e8d70f9bd8a9
103     Manager "ptcp:6640"
104         is_connected: true - can be a marker that ovs plugins successfully connected
105     ovs_version: "2.5.3"
106 on the host.