标签:ceilometer
Before you install andconfigure Telemetry, you must install MongoDB, create a MongoDB database, andcreate Identity service credentials including endpoints.
1. Install the MongoDBpackage:
# yum install mongodb-server mongodb
2. Edit the /etc/mongodb.conf file and complete the following actions:
a. Configure the bind_ip key to use the management interface IP address of the controllernode.
bind_ip =10.0.0.11
b. By default, MongoDB createsseveral 1 GB journal files in the /var/lib/mon- godb/journal directory. If you want to reduce the size of each journal file to128 MB and limit total journal space consumption to 512 MB, assert the small- files key:
smallfiles = true
You can also disable journaling. For more information, see the MongoDB manual.
c. Start the MongoDB servicesand configure them to start when the system boots:
# service mongod start
# chkconfig mongod on
3. Create the ceilometer database:
# mongo--host controller --eval ‘db =db.getSiblingDB("ceilometer"); db.addUser({user:"ceilometer", pwd: "CEILOMETER_DBPASS", roles: [ "readWrite","dbAdmin" ]})‘
Replace ceil〇meter_dbpass with asuitable password.
4. Source the admin credentials to gain access to admin-only CLI commands:
$ source admin-openrc.sh
5. To create the Identityservice credentials:
a. Create the ceilometer user:
$ keystone user-create --name ceilometer --pass CEILOMETER_PASS Replace CEILOMETER—PASS with a suitable password.
b. Link the ceilometer user to the service tenant and admin role:
$ keystone user-role-add --user ceilometer --tenant service--role admin
c. Create the ceilometer service:
$ keystone service-create --name ceilometer --type metering\ --description "Telemetry"
d. Create the Identity serviceendpoints:
$ keystone endpoint-create \
--service-id $(keystone service-list | awk ‘/metering / {print $2}‘) \
--publicurl http://controller:8777 \
--internalurl http://controller:81H\
--adminurl http://controller:8111 \
--region regionOne
To install and configure the Telemetry modulecomponents
1. Install the packages:
# yum installopenstack-ceilometer-api openstack-ceilometer-collector \openstack-ceilometer-notification openstack-ceilometer-central
openstack-ceilometer-alarm \ python-ceilometerclient
2. Generate a random value touse as the metering secret:
# openssl rand -hex 10
3. Edit the /etc/ceilometer/ceilometer.conf file andcomplete the following ac-tions:
a. In the [database] section, configure database access:
[database]
connection = mongodb://ceilometer: 701LOME
ceilometer
Replace CEILOMETER—DBPASS withthe password you chose for the Telemetry module database.
b In the [default] section, configure RabbitMQmessage broker access:
[DEFAULT]
rpc_backend = rabbit
rabbit_host= controller
rabbit_password = RABBIT_PASS
Replace ra^bbit_pa^SS with the password youchose for the guestaccount in RabbitMQ.
a. In the [DEFAULT] and [keystone_authtoken]sections, configure Identity service access:
[DEFAULT]
auth_strategy = keystone [keystone_authtoken]
auth_uri = http:// controller:SO 00/v2.0
identity_uri = http:// controller:3S3S1
admin_tenant_name = service admin_user = ceilometeradmin_password = CEIL〇METER_PASS
Replace CEILOmeter_pass with thepassword you chose for the celiometer user in theIdentity service.
Comment out any auth_host, auth_port, and auth_protocoloptions because the identity_uri option replaces them.
b. In the [service_credentials] section, configure service credentials:
[service_credentials]
os_auth_url = http:// controller:SO 00/v2.
os_username = ceilometer os_tenant_name = serviceos_password = CEIL〇METER_PASS
Replace CEIL〇meter_pass with thepassword you chose for the ceilometer user in theIdentity service.
c. In the [publisher] section, configure the metering secret:
[publisher]
metering_secret= METERING_SECRET
Replace metering_Secret with therandom value that you generated in a pre-vious step.
OpenStack Installation Guide for Red Hat Enterprise Linux, CentOS,and Fedora
? Start the Telemetryservices and configure them to start when the system boots:
# systemctlenable openstack-ceilometer-api.service openstack-ceilometer-notification.service \
openstack-ceilometer-central.serviceopenstack-ceilometer-collector. service \
openstack-ceilometer-alarm-evaluator.serviceopenstack-ceilometer-alarm- notifier.service
# systemctlstart openstack-ceilometer-api.service openstack-ceilometer- notification.service\
openstack-ceilometer-central.serviceopenstack-ceilometer-collector. service \
openstack-ceilometer-alarm-evaluator.serviceopenstack-ceilometer-alarm- notifier.service
Installthe Compute agent for Telemetry
Telemetry iscomposed of an API service, a collector and a range of disparate agents. Thissection explains how to install and configure the agent that runs on thecompute node.
1. Install the package:
# yum installopenstack-ceilometer-compute python-ceilometerclient python- pecan
2. Edit the /etc/nova/nova.conf file and add the following lines to the [default] section:
[default]
instance_usage_audit = Trueinstance_usage_audit_period = hour notify_on_state_change = vm_and_task_state
notification_driver = nova.openstack.common.notifier.rpc_notifiernotification_driver = ceilometer.compute.nova_notifier
3. Restart the Computeservice:
# systemctl restart openstack-nova-compute.service
To configure the Computeagent for Telemetry
Edit the /etc/ceilometer/ceilometer.conf file andcomplete the following actions:
1. In the [publisher] section, set the secret key for Telemetry service nodes:
[publisher]
# Secretvalue for signing metering messages (string value) metering_secret = CEIL〇METER_T〇KEN
Replace CEIL〇meter_t〇k^en with theceilometer token that you created previously.
2. In the [default] section, configure RabbitMQ broker access:
[DEFAULT]
rabbit_host = controller
rabbit_password= RABBIT_PASS
Replace ra^bbit_pa^sS with the password youchose for the guest account in Rabbit- MQ. —
3. In the [keystone_authtoken] section, configure Identity service access:
[keystone_authtoken]
auth_uri = http://controller:5000/v2.0
identity_uri = http:// controller:3 S3 SI
admin_tenant_name = service admin_user = ceilometeradmin_password = CEIL〇METER_PASS
Replace 〇eil〇meter_pa^sS with the password you chose for the Telemetry module database.
Comment outthe auth_host, auth_port, and auth_protocolkeys, since they are replaced by the identity_uri and auth_urikeys.
4. In the [service_credentials] section, configure service credentials:
[service_credentials]
os_auth_url = http://controller:5000/v2.0 os_username = ceilometer os_tenant_name = serviceos_password = CEIL〇METER_PASS os_endpoint_type= internalURL
Replace CEILOMETER_PASSwith the password you chose for the ceilometer user in the Identity service.
? Start the service andconfigure it to start when the system boots:
# systemctl enableopenstack-ceilometer-compute.service
# systemctl start openstack-ceilometer-compute.service
Configurethe Image Service for Telemetry
1. To retrieve image samples,you must configure the Image Service to send notifications to the bus.
Edit /etc/glance/glance-api.conf and modify the [DEFAULT]section:
notification_driver = messaging rpc_backend =rabbit
rabbit_host = controller
rabbit_password= RABBIT_PASS
2. Restart the Image Serviceswith their new settings:
OpenStack Installation Guide for Red Hat Enterprise Linux, CentOS,and Fedora
#systemctl restart registry.service
Add theBlock Storage service agent for Telemetry
1. To retrieve volume samples,you must configure the Block Storage service to send noti-fications to the bus.
Edit /etc/cinder/cinder.confand add in the [DEFAULT] sectionon the con-troller and volume nodes:
control_exchange = cinder
notification_driver = cinder.openstack.common.notifier.rpc_notifier
2. Restart the Block Storageservices with their new settings.
On the controller node:
# systemctl restart openstack-cinder-api.serviceopenstack-cinder- scheduler.service
On the storage node:
# systemctlrestart openstack-cinder-volume.service
3. If you want to collectOpenStack Block Storage notification on demand, you can usecinder-volume-usage-audit from OpenStack Block Storage. For more information,
BlockStorage audit script setup to get notifications.
Configure the ObjectStorage service for Teleme-try
1. Install thepython-ceilometerclient package on your Object Storage proxy server:
# yum install python-ceilometerclient
2. To retrieve object storestatistics, the Telemetry service needs access to Object Stor-age with the ResellerAdmin role. Give this role to your os_username userfor the
os_tenant_name tenant:
$ keystone role-create--name ResellerAdmin
+--------- +---------------------------------- +
| Property | Value |
+--------- +---------------------------------- +
| id | 462fa46c13fd4798a95a3bfbe27b5e54 |
| name 丨 ResellerAdmin |
+--------- +---------------------------------- +
$keystone user-role-add--tenant service --user ceilometer \
--role 462fa46c13fd4798a95a3bfbe27b5e54
3. You must also add theTelemetry middleware to Object Storage to handle incoming and outgoing traffic.Add these lines to the /etc/swift/proxy-server.conf file:
OpenStack Installation Guide for Red Hat Enterprise Linux, CentOS,and Fedora
[filter:ceilometer]use = egg:ceilometer#swift
4. Add ceilometer tothe pipeline parameter of that same file:
[pipeline:main]
pipeline = healthcheck cache authtoken keystoneauthceilometer proxy- server
5. Add the system user swift to the system group ceilometer to giveObject Storage access to the ceilometer.conf file.
# usermod -a -G ceilometer swift
6. Add ResellerAdmin to the operator_roles parameter of that samefile:
operator_roles =Member,admin,swiftoperator,_member_,ResellerAdmin
7. Restart the service withits new settings:
# systemctl restart openstack-swift-proxy.service
Verifythe Telemetry installation
To test the Telemetryinstallation, download an image from the Image Service, and use the ceilometercommand to display usage statistics.
1. Use the ceilometer meter-list command to test the access to Telemetry:
$ ceilometer meter-list
2. Download an image from theImage Service:
$ glanceimage-download "cirros-0.3.3-x86_64" > cirros.img
3. Call the ceilometer meter-list command again to validate that the download has been detected andstored by the Telemetry:
$ ceilometermeter-list
+--------------- +------ +----- +--------------------------------------
+-------- +---------------------------------- +
| Name | Type | Unit | ResourceID |
User ID | Project ID |
+--------------- +------ +----- +--------------------------------------
+-------- +---------------------------------- +
| image | gauge | image | acafc7c0-40aa-4026-9673-b879898e1fc2 |
None | efa984b0a914450e9a47788ad330699d |
| image.download | delta | B | acafc7c0-40aa-4026-9673-b879898e1fc2 |
None | efa984b0a914450e9a47788ad330699d |
| image.serve | delta | B | acafc7c0-40aa-4026-9673-b879898e1fc2 |
None | efa984b0a914450e9a47788ad330699d |
| image.size | gauge | B | acafc7c0-40aa-4026-9673-b879898e1fc2 |
None | efa984b0a914450e9a47788ad330699d |
4. You can now get usagestatistics for the various meters:
$ ceilometer statistics -m image.download -p 60 |
版权声明:本文为博主原创文章,未经博主允许不得转载。
centos7 安装配置openstack-ceilometer (官网openstack-juno版)
标签:ceilometer
原文地址:http://blog.csdn.net/qq_21398167/article/details/47019751