progetti:cloud-areapd:operations:monitoring
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| progetti:cloud-areapd:operations:monitoring [2015/02/13 18:00] – [Installation on Compute Nodes] verlato@infn.it | progetti:cloud-areapd:operations:monitoring [2016/03/07 10:57] (current) – [Installation on Controller] verlato@infn.it | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Monitoring ====== | ||
| + | ===== Ganglia ===== | ||
| + | [[http:// | ||
| + | |||
| + | |||
| + | ===== Nagios ====== | ||
| + | |||
| + | [[http:// | ||
| + | |||
| + | ==== Active sensors ==== | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | ===== Ceilometer ===== | ||
| + | Installation instructions for Icehouse on: | ||
| + | * http:// | ||
| + | * https:// | ||
| + | Graphic interface available in Horizon: | ||
| + | * https:// | ||
| + | ==== Installation on Controller ==== | ||
| + | <code bash> | ||
| + | #!/bin/sh | ||
| + | export CEILOHOST=controller-01.pd.infn.it | ||
| + | export CEILOHOSTPV=controller-01.cloud.pd.infn.it | ||
| + | export DBHOST=cld-nagios | ||
| + | export KEYHOST=cloud-areapd.pd.infn.it | ||
| + | export RABBITHOSTS=" | ||
| + | # | ||
| + | yum install -y openstack-ceilometer-api openstack-ceilometer-collector openstack-ceilometer-notification openstack-ceilometer-central openstack-ceilometer-alarm python-ceilometerclient | ||
| + | |||
| + | ## the lines below to be executed on $DBHOST | ||
| + | #cat <<EOF >/ | ||
| + | #[mongodb] | ||
| + | # | ||
| + | # | ||
| + | #gpgcheck=0 | ||
| + | #enabled=1 | ||
| + | #EOF | ||
| + | # | ||
| + | #yum install -y mongodb-org | ||
| + | #service mongod start | ||
| + | #chkconfig mongod on | ||
| + | #mongo --host $DBHOST --eval 'db = db.getSiblingDB(" | ||
| + | ## end of lines to be executed on $DBHOST | ||
| + | # | ||
| + | ## if mongodb already in place at $DBHOST and ceilometer DB not yet created, you can do it from the controller as below: | ||
| + | yum install -y mongodb-org-shell | ||
| + | mongo --host $DBHOST --eval 'db = db.getSiblingDB(" | ||
| + | ## end of $DBHOST stuff | ||
| + | # | ||
| + | openstack-config --set / | ||
| + | # | ||
| + | CEILOMETER_TOKEN=$(openssl rand -hex 10) | ||
| + | echo $CEILOMETER_TOKEN | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | # | ||
| + | source keystone_admin.sh | ||
| + | keystone user-create --name=ceilometer --pass=CEILOMETER_PASS --email=ceilometer@example.com | ||
| + | keystone user-role-add --user=ceilometer --tenant=services --role=admin | ||
| + | keystone service-create --name=ceilometer --type=metering | ||
| + | keystone endpoint-create --region=regionOne --service-id=$(keystone service-list | awk '/ metering / {print $2}') --publicurl=https:// | ||
| + | # | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | # | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | service openstack-cinder-api restart | ||
| + | service openstack-cinder-volume restart | ||
| + | # | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | service openstack-glance-api restart | ||
| + | service openstack-glance-registry restart | ||
| + | # | ||
| + | for i in `ls / | ||
| + | </ | ||
| + | ==== Installation on Compute Nodes ==== | ||
| + | <code bash> | ||
| + | #!/bin/sh | ||
| + | export KEYHOST=cloud-areapd.pd.infn.it | ||
| + | export RABBITMGIP=192.168.60.100 | ||
| + | export RABBITHOSTS=" | ||
| + | export CEILOMETER_TOKEN=5bfc5aa7fb1162dad8f1 | ||
| + | # | ||
| + | # 1) do not forget to add in nova.conf: | ||
| + | #[DEFAULT] | ||
| + | #... | ||
| + | # | ||
| + | # | ||
| + | sed -i ' | ||
| + | # | ||
| + | # 2) use the same $CEILOMETER_TOKEN created on the Controller Node | ||
| + | # | ||
| + | yum install -y openstack-ceilometer-compute | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | # | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | sed -i 's|- cpu_sink|- cpu_sink\n | ||
| + | cat <<EOF >> / | ||
| + | - name: cpu_sink.hrs | ||
| + | transformers: | ||
| + | - name: " | ||
| + | parameters: | ||
| + | target: | ||
| + | name: " | ||
| + | scale: " | ||
| + | unit: " | ||
| + | type: " | ||
| + | publishers: | ||
| + | - rpc:// | ||
| + | EOF | ||
| + | service openstack-nova-compute restart | ||
| + | service openstack-ceilometer-compute start | ||
| + | chkconfig openstack-ceilometer-compute on | ||
| + | service openstack-ceilometer-compute status | ||
| + | ls -l / | ||
| + | </ | ||
| + | ==== Testing from Controller ==== | ||
| + | <code bash> | ||
| + | source ceilometerrc.sh | ||
| + | # show meters and resources | ||
| + | ceilometer meter-list | ||
| + | ceilometer resource-list | ||
| + | |||
| + | # show the entire sample for a given meter for all resources | ||
| + | ceilometer sample-list -m cpu | ||
| + | |||
| + | # show the aggregate statistics (average, maxima, minima, sum, count) for a given meter for all resources | ||
| + | ceilometer statistics -m cpu | ||
| + | ceilometer statistics -m cpu.hours | ||
| + | ceilometer statistics -m cpu_util | ||
| + | |||
| + | # cpu for an instance is defined as the Total cpu_time (in nanoseconds) output from the command "virsh cpu-stats instance-id" | ||
| + | # cpu_util is (cpu_t2 - cpu_t1)*100/ | ||
| + | |||
| + | # show the sample for a given resource after a given start time | ||
| + | START=2015-02-09T12: | ||
| + | INSTANCE=67fccb06-b80e-42ab-9fca-f5e57adaba7 | ||
| + | ceilometer sample-list -m cpu.hours -q " | ||
| + | |||
| + | # show the aggregate statistics (average, maxima, minima, sum, count) for a given resource after a given start time for a given period (here 3600 seconds) | ||
| + | ceilometer statistics -m cpu.hours -q " | ||
| + | </ | ||
| + | ==== Set up a monthly backup of Ceilometer DB ==== | ||
| + | * Inspired by the instructions [[http:// | ||
| + | * From the controller node execute the script below: | ||
| + | <code bash> | ||
| + | [root@cld-ctrl-01 ceilometer]# | ||
| + | #!/bin/sh | ||
| + | export DBHOST=cld-nagios | ||
| + | export DBHOSTIP=192.168.60.32 | ||
| + | cat <<EOF >/ | ||
| + | [mongodb] | ||
| + | name=MongoDB Repository | ||
| + | baseurl=http:// | ||
| + | gpgcheck=0 | ||
| + | enabled=1 | ||
| + | EOF | ||
| + | yum -y install mongodb-org-shell mongodb-org-tools | ||
| + | # set time_to_live to 32 days | ||
| + | openstack-config --set / | ||
| + | for i in `ls / | ||
| + | # copying the mongo_backup.py script | ||
| + | git clone https:// | ||
| + | useradd ceilobackup | ||
| + | cp arcus-energy-monitoring-tool/ | ||
| + | cd / | ||
| + | # set properly the DB host_ip (the one of cld-nagios) and ceilometer username password | ||
| + | sed -i ' | ||
| + | sed -i ' | ||
| + | sed -i ' | ||
| + | sed -i ' | ||
| + | sed -i ' | ||
| + | sed -i ' | ||
| + | # | ||
| + | chown ceilobackup.ceilobackup / | ||
| + | su - ceilobackup -c " | ||
| + | # purge monthly the DB: | ||
| + | cat <<EOF >/ | ||
| + | 0 0 1 * * ceilobackup python mongo_backup.py; | ||
| + | EOF | ||
| + | </ | ||
