diff --git a/files/apts/ceilometer-collector b/files/apts/ceilometer-collector index 71007ba4c5..f1b692ac71 100644 --- a/files/apts/ceilometer-collector +++ b/files/apts/ceilometer-collector @@ -1,5 +1,5 @@ -python-pymongo -mongodb-server +python-pymongo #NOPRIME +mongodb-server #NOPRIME libnspr4-dev pkg-config libxml2-dev diff --git a/files/rpms/ceilometer-collector b/files/rpms/ceilometer-collector index c91bac36a2..9cf580d22d 100644 --- a/files/rpms/ceilometer-collector +++ b/files/rpms/ceilometer-collector @@ -1,4 +1,4 @@ selinux-policy-targeted -mongodb-server -pymongo +mongodb-server #NOPRIME +pymongo # NOPRIME mongodb # NOPRIME diff --git a/lib/ceilometer b/lib/ceilometer index b0899e2f24..6aaddcefad 100644 --- a/lib/ceilometer +++ b/lib/ceilometer @@ -106,7 +106,9 @@ create_ceilometer_accounts() { # cleanup_ceilometer() - Remove residual data files, anything left over from previous # runs that a clean run would need to clean up function cleanup_ceilometer { - mongo ceilometer --eval "db.dropDatabase();" + if [ "$CEILOMETER_BACKEND" != 'mysql' ] && [ "$CEILOMETER_BACKEND" != 'postgresql' ] ; then + mongo ceilometer --eval "db.dropDatabase();" + fi } # configure_ceilometerclient() - Set config files, create data dirs, etc @@ -164,14 +166,27 @@ function configure_ceilometer { } function configure_mongodb { + # server package is the same on all + local packages=mongodb-server + + if is_fedora; then + # mongodb client + python bindings + packages="${packages} mongodb pymongo" + else + packages="${packages} python-pymongo" + fi + + install_package ${packages} + if is_fedora; then - # install mongodb client - install_package mongodb # ensure smallfiles selected to minimize freespace requirements sudo sed -i '/--smallfiles/!s/OPTIONS=\"/OPTIONS=\"--smallfiles /' /etc/sysconfig/mongod restart_service mongod fi + + # give mongodb time to start-up + sleep 5 } # init_ceilometer() - Initialize etc.