Skip to content

Instantly share code, notes, and snippets.

@masudiiuc
Created February 5, 2014 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masudiiuc/8825509 to your computer and use it in GitHub Desktop.
Save masudiiuc/8825509 to your computer and use it in GitHub Desktop.
Solution: MongoDB unable to connect due to sudden shutdown of machine....
Step 1: Remove lock file.
sudo rm /var/lib/mongodb/mongod.lock
Step 2: Repair mongodb.
mongod --repair
Step 3: start mongodb.
sudo start mongodb
or
sudo service mongodb start
Step 4: Check status of mongodb.
sudo status mongodb
or
sudo service mongodb status
Step 5: Start mongo console.
mongo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment