Fix mongodb service is not starting up

Posted by Carles Loriente on January 05, 2020 · 1 min read
Updated on December 25, 2024

Sometimes (not many) MongoDB can’t start normally, if there isn’t any configuration change for your side, you can fix it using the following commands.


sudo rm /var/lib/mongo/mongod.lock
sudo mongod --repair -dbpath /var/lib/mongo
sudo service mongod start

Tags:#mongodb


Found a snippet that saved your day? Consider dropping a tip!