Skip to content

Instantly share code, notes, and snippets.

@isaquealves
Created January 3, 2017 23:43
Show Gist options
  • Save isaquealves/937eea6f527d64ce38060a25660c7275 to your computer and use it in GitHub Desktop.
Save isaquealves/937eea6f527d64ce38060a25660c7275 to your computer and use it in GitHub Desktop.
If mongo db is refusing to start, lets kill him, force a repair, set proper ownership for db directory and then restart and check service status. Should be active.
sudo rm /var/lib/mongodb/mongod.lock
sudo mongod --repair --dbpath=/var/lib/mongodb
sudo chown -R mongodb:mongodb /var/lib/mongodb
sudo service mongod restart
sudo service mongod status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment