Skip to content

Restarting Repairing Mongo

David Adams edited this page Jan 17, 2017 · 2 revisions

Sometimes mongo doesn't start up correctly, and there's a meme floating around that people can run:

sudo mongod --repair --dbpath /edx/var/mongo/mongodb

to fix their instance when Mongo refuses to start up because of database synching problems. This is good.

But people have also been manually invoking mongo like this:

sudo mongod --dbpath /edx/var/mongo/mongodb

I contend that this inferior to invoking mongo like this:

sudo mongod -f /etc/mongodb.conf

This will make sure that the same database gets used, but will also put logs in the places you expect them.

The above doesn't always work for me (dca) but this does:

sudo rm /edx/var/mongo/mongodb/mongod.lock
sudo mongod -repair --config /etc/mongod.conf
sudo chown -R mongodb:mongodb /edx/var/mongo/mongodb/.
Clone this wiki locally