Sometimes during development with MongoDB I have experienced that MongoDB crashes , In this blog I am sharing how to recover from a crashed MongoDB instance.
First I am going to show steps in windows OS:
There is a file named “mongod.lock” in C:\data\db directory.
First you need to delete this file.
Then you need to restart mongodb by applying following command in command prompt with administrative priviledges:
net start MongoDB
Now I am going to show steps in Ubuntu OS:
There is a file named “mongod.lock” in /var/lib/mongodb directory.
You need to delete this file by the following command:
sudo rm -f /var/lib/mongodb/mongod.lock
Then you need to restart mongodb by applying following command in terminal:
sudo service mongodb start
Akash Sharma
More From Oodles
Ready to innovate? Let's get in touch
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Akash Sharma
Akash is a bright Groovy and Grails developer and have worked on development of various SaaS applications using Grails technologies. Akash loves playing Cricket and Tennis