Install the Metering Service
Install the central Metering Service components
The Metering service consists of an API service, collector,
and a range of disparate agents. This procedure details how to
install the core components before you install the agents
elsewhere, such as on the compute node.
Install the Metering Service on the controller
node:
# apt-get install ceilometer-api ceilometer-collector ceilometer-agent-central python-ceilometerclient
# yum install openstack-ceilometer-api openstack-ceilometer-collector openstack-ceilometer-agent-central python-ceilometerclient FIXME
# zypper install openstack-ceilometer-api openstack-ceilometer-collector openstack-ceilometer-agent-central python-ceilometerclient
Answer to the debconf
prompts about the API endpoint registration, the RabbitMQ credentials,
and the keystone_autotoken
.
The Metering Service uses a database to store information.
Specify the location of the database in the configuration
file. The examples in this guide use a MongoDB database on the
controller node.
# FIXME
# zypper install mongodb
# apt-get install mongodb
Start the MongoDB server and configure it to start when
the system boots:
# systemctl start mongodb.service
# systemctl enable mongodb.service
Create the database and a ceilometer
user for it:
# mongo
> use ceilometer
> db.addUser( { user: "ceilometer",
pwd: "CEILOMETER_DBPASS",
roles: [ "readWrite", "dbAdmin" ]
} )
Tell the Metering Service to use the created
database.
# openstack-config --set /etc/ceilometer/ceilometer.conf \
database connection mongodb://ceilometer:CEILOMETER_DBPASS@controller:27017/ceilometer
Edit
/etc/ceilometer/ceilometer.conf and
change the [database] section.
...
[database]
...
# The SQLAlchemy connection string used to connect to the
# database (string value)
connection = mongodb://ceilometer:CEILOMETER_DBPASS@controller:27017/ceilometer
...
You must define an secret key that is used as a shared
secret between the Metering Service nodes. Use
openssl to generate a random token and
store it in the configuration file.
# ADMIN_TOKEN=$(openssl rand -hex 10)
# echo $ADMIN_TOKEN
# openstack-config --set /etc/keystone/keystone.conf publisher_rpc metering_secret $ADMIN_TOKEN
For SUSE Linux Enterprise use instead
as first command:
# ADMIN_TOKEN=$(openssl rand 10|hexdump -e '1/1 "%.2x"')
# openssl rand -hex 10
Edit
/etc/ceilometer/ceilometer.conf and
change the [DEFAULT] section, replacing
ADMIN_TOKEN with the results of the command.
...
[publisher_rpc]
...
# Secret value for signing metering messages (string value)
metering_secret = ADMIN_TOKEN
...
Create a user called ceilometer so that
the Metering Service can use to authenticate with the Identity
Service. Use the service tenant and give
the user the admin role.
# keystone user-create --name=ceilometer --pass=CEILOMETER_PASS --email=ceilometer@example.com
# keystone user-role-add --user=ceilometer --tenant=service --role=admin
Add the credentials to the configuration files for the
Metering Service.
# openstack-config --set /etc/ceilometer/ceilometer.conf keystone_authtoken auth_host controller
# openstack-config --set /etc/ceilometer/ceilometer.conf keystone_authtoken admin_user ceilometer
# openstack-config --set /etc/ceilometer/ceilometer.conf keystone_authtoken admin_tenant_name service
# openstack-config --set /etc/ceilometer/ceilometer.conf keystone_authtoken auth_protocol http
# openstack-config --set /etc/ceilometer/ceilometer.conf keystone_authtoken admin_password CEILOMETER_PASS
Edit
/etc/ceilometer/ceilometer.conf and
change the [keystone_authtoken]
section.
...
[keystone_authtoken]
auth_host = controller
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = ceilometer
admin_password = CEILOMETER_PASS
...
Register the Metering Service with the Identity Service so
that other OpenStack services can locate it. Register the
service and specify the endpoint using the
keystone command.
# keystone service-create --name=ceilometer --type=metering \
--description="Ceilometer Metering Service"
Note the id property for the service
that was returned in the previous step. Use it when you create
the endpoint.
# keystone endpoint-create \
--service-id=the_service_id_above \
--publicurl=http://controller:8777/ \
--internalurl=http://controller:8777/ \
--adminurl=http://controller:8777/
Restart the service with its new settings.
# service ceilometer-agent-central restart
# service ceilometer-api restart
# service ceilometer-collector restart
Start the ceilometer-api, ceilometer-agent-central and ceilometer-collector services
and configure them to start when the system boots.
# service openstack-ceilometer-api start
# service openstack-ceilometer-agent-central start
# service openstack-ceilometer-collector start
# chkconfig openstack-ceilometer-api on
# chkconfig openstack-ceilometer-agent-central on
# chkconfig openstack-ceilometer-collector on