Install and Configure OpenStack Telemetry Metering Service (Ceilometer)

Based on OpenStack Icehouse release


we will install Telemetry service on controller node

1. yum -y install openstack-ceilometer-api openstack-ceilometer-collector openstack-ceilometer-notification openstack-ceilometer-central openstack-ceilometer-alarm python-ceilometerclient

2. mysql -uroot -p
mysql> create database ceilometer;
mysql> grant all privileges on ceilometer.* to 'ceilometer'@'localhost' identified by 'CEILOMETER-DBPASS';
mysql> grant all privileges on ceilometer.* to 'ceilometer'@'%' identified by 'CEILOMETER-DBPASS';
mysql> flush privileges;

3. vi /etc/ceilometer/ceilometer.conf
[database]
connection=mysql://ceilometer:ceilometer@MYSQL-SERVER/ceilometer


ceilometer-dbsync


4. # create ceilometer user
keystone user-create --tenant service --name ceilometer --pass CEILOMETER-USER-PASS

# Add role to the ceilometer user
keystone user-role-add --user=ceilometer --tenant=service --role=admin

# create ceilometer service
keystone service-create --name=ceilometer --type=metering --description="Telemetry Service"

# create ceilometer endpoint
keystone endpoint-create --region RegionOne --service ceilometer --publicurl=http://controller:8777 --internalurl=http://controller:8777 --adminurl=http://controller:8777

5. vi /etc/ceilometer/ceilometer.conf

[publisher]
metering_secret=SECRET-STRING-YOU-SPECIFY

[DEFAULT]

rpc_backend=ceilometer.openstack.common.rpc.impl_qpid

qpid_hostname=controller

auth_strategy=keystone

[keystone_authtoken]
auth_host = controller
auth_port = 35357
auth_protocol = http
auth_uri = http://controller:5000
admin_tenant_name = service
admin_user = ceilometer
admin_password = CEILOMETER-USER-PASSWORD
[service_credentials]
os_username=ceilometer
os_password=CEILOMETER-USER-PASSWORD
os_tenant_name=service
os_auth_url=http://controller:5000/v2.0

6. chown -R ceilometer:ceilometer /etc/ceilometer /var/log/ceilometer

for service in api notification central collector alarm-evaluator alarm-notifier; do
service openstack-ceilometer-$service start
chkconfig openstack-ceilometer-$service on
done

Install the Compute agent for Telemetry on computer node

1. yum -y install openstack-ceilometer-compute python-ceilometerclient python-pecan

2. vi /etc/nova/nova.conf
[DEFAULT]
instance_usage_audit=True
instance_usage_audit_period=hour
notify_on_state_change=vm_and_task_state
notification_driver=nova.openstack.common.notifier.rpc_notifier
notification_driver=ceilometer.compute.nova_notifier

service openstack-nova-compute restart

3. vi /etc/ceilometer/ceilometer.conf
[publisher]
metering_secret=SECRET-STRING-YOU-SPECIFY

rpc_backend=ceilometer.openstack.common.rpc.impl_qpid

qpid_hostname = controller
[keystone_authtoken]
auth_host = controller
auth_port = 35357
auth_protocol = http
auth_uri = http://controller:5000
admin_tenant_name = service
admin_user = ceilometer
admin_password = CEILOMETER-USER-PASSWORD
[service_credentials]
os_username=ceilometer
os_password=CEILOMETER-USER-PASSWORD
os_tenant_name=service
os_auth_url=http://controller:5000/v2.0

4. chown -R ceilometer:ceilometer /etc/ceilometer /var/log/ceilometer
service openstack-ceilometer-compute start; chkconfig openstack-ceilometer-compute on


Configure the Image Service for Telemetry

on Glance Image Service node
1. vi /etc/glance/glance-api.conf
notification_driver=messaging

2. service openstack-glance-api restart; service openstack-glance-registry restart

Config the Block Storage service agent for Telemetry

on the cinder controller and volume nodes

vi /etc/cinder/cinder.conf
control_exchange=cinder
notification_driver=cinder.openstack.common.notifier.rpc_notifier

On the cinder controller node:
service openstack-cinder-api restart; service openstack-cinder-scheduler restart

On the cinder volume node:
service openstack-cinder-volume restart


Configure the Object Storage service for Telemetry

on keystone node:

keystone role-create --name=ResellerAdmin
keystone user-role-add --tenant service --user ceilometer --role ResellerAdmin

on swift proxy node:

vi /etc/swift/proxy-server.conf
# include ceilometer
[pipeline:main]
pipeline = healthcheck cache authtoken keystoneauth ceilometer proxyserver

# add at the last line
[filter:ceilometer]
use = egg:ceilometer#swift

service openstack-swift-proxy restart

Verify Telemetry Installation

source ~/adminrc

keystone user-role-add --tenant admin --user admin --role ResellerAdmin

keystone user-role-add --tenant demo1 --user demo1 --role ResellerAdmin

ceilometer meter-list

你可能感兴趣的:(telemetry)