Ask Your Question

How to safely clear Ceilometer database?

asked 2013-11-20 13:46:36 -0500

sgordon gravatar image

updated 2013-11-20 14:24:14 -0500

I have an "all in one" OpenStack setup running Havana (RDO) that has been up for around 10 days. As well as flooding the MySQL token database (expected and since resolved) I also noticed that it has a large amount of data (3 G) under /var/lib/mongodb/journal/ which I believe is associated with Ceilometer.

There are three files in the directory of 1 G each, j._0, prealloc.1, and prealloc.2 as well as an 88 byte file names lsn. I'm not familiar with MongoDB at all so my question is how to safely clear the database? I have tried using the mongo client:

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

But the files listed above stay on, even after a system restart. I am also wondering if this volume of metering data is expected/normal for such a small setup that has mostly been dormant for such a short period of time?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2013-11-25 08:04:23 -0500

rook gravatar image

updated 2013-11-26 13:05:27 -0500

sgordon gravatar image

It seems like if you drop the db, then remove the preallocated files, you will be fine.

Preallocated files do not contain data. It is safe to later remove them. But if you restart mongod with journaling, mongod will create them again.

Using the smallfiles directive may also help:

edit flag offensive delete link more


Using the above links, the following worked for me: Add line: vi /etc/mongod.conf smallfiles = true Add line: vi /etc/init.d/mongod MONGODB_OPTIONS="--nojournal"

Kunal Patil gravatar imageKunal Patil ( 2013-12-17 02:29:21 -0500 )edit

answered 2013-12-17 10:11:06 -0500

For --allinone, packstack should really config mongo to use minimal space:

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2013-11-20 13:46:36 -0500

Seen: 2,644 times

Last updated: Jan 21 '14