This section instructs you on how to troubleshoot the MongoDB failures.
To troubleshoot MongoDB:
Log in to the MongoDB shell as Administrator into the admin
collection:
mongo -uadmin -p$(salt-call pillar.get mongodb:server:admin:password|tail -1|tr -d ' ') admin
Verify the replica set configuration and status:
rs.conf()
rs.status()
To force synchronization of one of the replicas, delete data in the replica directory and start MongoDB:
Caution
Proceed with caution to avoid any data loss.
service mongodb stop
mv /var/lib/mongodb /var/lib/mongodb.backup
mkdir /var/lib/mongodb
chown mongodb:mongodb /var/lib/mongodb
service mongodb start