Ask Your Question

How to clean up old ceilometer data ?

asked 2014-06-09 04:36:55 -0500


i have installed ceilometer on my controller node and today I check that mongodb database size is 11 GB. I want to cleanup old data, how can I do ? There is a procedure/method ?



edit retag flag offensive close merge delete

4 answers

Sort by » oldest newest most voted

answered 2015-09-09 15:55:11 -0500

*Recreating the Ceilometer DB seems extreme to clean up data.

*I believe TTL will only delete old records from this point on not historical records.

Log in and see if the TTL modification actually decreased the size with the following commands.

mongo -u ceilometer -p {PASSWORD} ceilometer

show collections;






To configure TTL you’ll need to: update Ceilometer config on every controller node “/etc/ceilometer/ceilometer.conf” and set the “time_to_live” parameter to “86400” (1 day). or whatever period is suitable.

Next step you need is to setup cron job for ceilometer-expirer script:

run “crontab -e” in CLI, paste

0 0 * * * ceilometer-expirer --config-file /etc/ceilometer/ceilometer.conf

and save.

Then restart ceilometer-collector service on all controller nodes:

You can also manually remove a meter post a certain date with this command

edit flag offensive delete link more

answered 2014-08-14 17:42:42 -0500

fgorbat gravatar image

updated 2014-08-14 17:44:33 -0500


Here is the procedure:
1. Drop ceilometer db by:

mongo --eval "db.dropDatabase();"

2. Stop mongo db

service mongod stop

3. Remove the data files from the disk

rm -f /var/lib/mongodb/ceilometer.*

4. Start mongo

service mongod start

Note: Validate correct startup by service mongod status

5. Recreate ceilometer db

mongo --host controller --eval '
db = db.getSiblingDB("ceilometer");
db.addUser({user: "ceilometer",
            pwd: "CEILOMETER_DBPASS",
            roles: [ "readWrite", "dbAdmin" ]})'

6. Restart ceilometer services

service openstack-ceilometer-api restart
service openstack-ceilometer-notification restart
service openstack-ceilometer-central restart
service openstack-ceilometer-collector restart
service openstack-ceilometer-alarm-evaluator restart
service openstack-ceilometer-alarm-notifier restart
edit flag offensive delete link more


Do these instructions change if you have a 3 node mongoDB setup?

Jet gravatar imageJet ( 2015-04-15 15:17:22 -0500 )edit

answered 2015-09-09 10:21:18 -0500


I have another solution in configuration of ceilometer. If you open ceilometer.conf file you can found this code:

# number of seconds that samples are kept in the database for
# (<= 0 means forever) (integer value)

By default the time_to_live is set to 0 that means forever! I have set the value to 604800 ( 7 days x 24 hours x 60 minute x 60 second ) and now my database does not grow.

edit flag offensive delete link more


Nice option.

mark gravatar imagemark ( 2015-10-08 00:24:29 -0500 )edit

answered 2017-11-14 02:35:53 -0500

AbuAyesha gravatar image

After changing the configuration for TTL with required time. Is that fine if we restart openstack ceilometer service

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools



Asked: 2014-06-09 04:36:55 -0500

Seen: 8,237 times

Last updated: Nov 14 '17