The following is performed on the overcloud controllers.
- First of all stop telemetry with the following command.
systemctl stop openstack-aodh-evaluator openstack-aodh-listener openstack-aodh-notifier openstack-ceilometer-central openstack-ceilometer-collector openstack-ceilometer-notification openstack-gnocchi-metricd openstack-gnocchi-statsd
- Stop the mongod service.
systemctl stop mongod
- Backup MongoDB files.
tar Jcf /tmp/mongodb-backup-$HOSTNAME-$(date +%F_%H%M%S).tar.xz /var/lib/mongodb
- Delete the following files from the /var/lib/mongodb/ folder.
rm -r /var/lib/mongodb/*
- Start mongodb on each of the three controllers.
systemctl start mongod
- We decided to make mongodb master on controller0.
mongo --host MONGOHOST --eval 'rs.initiate()'
- Determine mongodb’s listener IP on controller 1 and controller 2.
ss -tlnp|grep mongo
- Add these IPs to the mongo replication configuration.
mongo --host MONGOHOST --eval 'rs.add("controler1_mongodb_IP:PORT"); rs.add("controler2_mongodb_IP:PORT"); '
- Keep an eye on the status.
mongo --host MONGOHOST --eval 'db.isMaster()' # to check which node is the master. Should be only contorller0 mongo --host MONGOHOST --eval 'rs.conf()' # to check that all hosts are in the cluster mongo --host MONGOHOST --eval 'rs.status()' # to check the replication status
- Create the ceilometer database in mongodb.
mongo --host MONGOHOST --eval 'db.getSiblingDB("ceilometer").addUser({user: "ceilometer", pwd: "MONGOPASS", roles: [ "readWrite", "dbAdmin" ]})'
- Start telemetry.
systemctl start openstack-aodh-evaluator openstack-aodh-listener openstack-aodh-notifier openstack-ceilometer-central openstack-ceilometer-collector openstack-ceilometer-notification openstack-gnocchi-metricd openstack-gnocchi-statsd