12.6. Configure the Telemetry Database Connection
The database connection URL used by the Telemetry service is defined in the
/etc/ceilometer/ceilometer.conf file. This URL must be set to point to a valid database server before launching the Telemetry API service (openstack-ceilometer-api), Notification agent (openstack-ceilometer-notification) and Collector agent (openstack-ceilometer-collector). The Telemetry service uses this database server as its back-end data repository; by default, the Telemetry service uses MongoDB.
To set the database connection string, run the following command as the
root user on the system hosting the openstack-ceilometer-api and openstack-ceilometer-collector services:
#openstack-config --set /etc/ceilometer/ceilometer.conf \database connection mongodb://ceilometer:MONGOPASS@MONGOHOST/ceilometer
Where:
- MONGOPASS is the password of the
ceilometeruser, required by the Telemetry service to log on to the database server. Supply these credentials only when required by the database server (for example, when the database server is hosted on another system or node). - MONGOHOST is the IP address/hostname and port of the system hosting the database server.
Note
This assumes that you created a MongoDB database user named
ceilometer with the password MONGOPASS, as instructed in Section 12.6.1, “Configure and Launch the MongoDB Back-End”.
If MongoDB is hosted locally on the same host, the required database connection string would be:
mongodb://localhost:27017/ceilometer
As in:
#openstack-config --set /etc/ceilometer/ceilometer.conf \database connection mongodb://localhost:27017/ceilometer
12.6.1. Configure and Launch the MongoDB Back-End
The Telemetry service uses MongoDB as its back-end data repository. As such, you will need to start the
mongod service.
Before doing so, you may want to configure
mongod to run with the --smallfiles parameter. This parameter configures MongoDB to use a smaller default data file and journal size. With this, MongoDB will limit the size of each data file, creating and writing to a new one when it reaches 512MB.
You can configure
mongod to run with this parameter using /etc/sysconfig/mongod. To do so, specify --smallfiles in the OPTIONS section of /etc/sysconfig/mongod, as in:
OPTIONS="--smallfiles /etc/mongodb.conf"
MongoDB will use all parameters specified in the
OPTIONS section when mongod launches. To start the MongoDB service:
#service mongod start