Skip to content

Instantly share code, notes, and snippets.

@walbinjr
Last active January 2, 2018 17:11
Show Gist options
  • Save walbinjr/0d682cd95c1f8e0e60ed52d37f5a2dec to your computer and use it in GitHub Desktop.
Save walbinjr/0d682cd95c1f8e0e60ed52d37f5a2dec to your computer and use it in GitHub Desktop.
Fixing MongoDB against unclean shutdown
# Execute with sudo
grep -i dbpath /etc/mongod.conf
# dbpath=/var/lib/mongodb
rm /var/lib/mongodb/mongod.lock
mongod --repair --dbpath /var/lib/mongodb
chown -R mongodb:mongodb /var/lib/mongodb
service mongod restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment