Recovering the MongoDB replicaset after a hard server reboot on 32bit systems

If one of your check servers crashes/was hard rebooted and it is running MongoDB you will most likely need to resync the MongoDB replicaset since the 32bit version of MongoDB doesn't use journaling.

First, check to see if your MongoDB instance needs to be resynced, tail the /var/log/mongo/mongod.log and if you see the following you will need to perform a resync.

e.g.

tail -n 100 /var/log/mongo/mongod.log

**************

Unclean shutdown detected.

Please visit http://dochub.mongodb.org/core/repair for recovery instructions.

*************

If you don't see a message about an unclean shutdown then your replica set is fine and doesn't need repaired.

If you do see this message, then ssh to the server that was rebooted and issue the following commands which backs up the existing replicaset data on that server, then removes it so it can be resynced. (If you have recovered this mongodb instance before you will need to use a different backup directory name instead of mongo-bk or remove the old mongo-bk before issuing the following commands).

mv /var/lib/mongo /var/lib/mongo-bk
mkdir /var/lib/mongo
cp /var/lib/mongo-bk/key /var/lib/mongo/.
chown mongod:mongod /var/lib/mongo
service mongod start

Upon starting up mongo, the replicaset will automatically be resynced.
  • 202 Users Found This Useful
Was this answer helpful?

Related Articles

Sample Web Hook

  As part of our API alerts feature, your customers can add custom web hooks which will be...

Enabling Support for Pushover

Pushover.net provides push notifications for iOS, Android, and Desktop enviornments for a low...

EULA

END USER LICENSE AGREEMENT This copy of ServerPing ("the Software Product") and...

Create a package and restrict checks to those listed in the clients services

ServerPing supports creating a product/service and restricting the checks that a customer can add...

Features in Development

ServerPing is always looking for ways to become even better, if you have any feature suggestions,...