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

Adding ServerPing to your Client Area template

You will need to provide a link to the SeverPing module from your client area. We recommend...

Setting up a Custom SMS Gateway

In version 1.08 or later, ServerPing supports using any SMS gateway through a custom php...

Terms and Conditions

Terms and Conditions   Agreement between user and serverping.net Welcome to serverping.net....

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...

Using an SMTP Server to Send Email Alerts

By default ServerPing will send email alerts using sendmail on the check worker server. If you...