Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Web Technology by (50.2k points)

While working on my mongodb-v1.8.1, my server gets hanged and then I restarted my server. Once the server comes back, I was not able to start my mongodb. I, then, removed the mongo.lock file and after removing, I ran repair database query. Now my mongo is running fine. I got confused with the mongo.lock file. What is the value of that particular mongo.lock file? Will my existing data get affected by removing the mongo.lock file? 

1 Answer

0 votes
by (108k points)
edited by

When the MongoDB server gets started, all the happenings that happen inside the mongo server is written inside the mongod.lock file. If the server gets stopped then this file gets dropped. If the server is not properly shut down then this will corrupt the mongod.lock file which then shows us the error or warning that you are getting. If you remove the mongod.lock file, then this will not cause any harm to your stored data. 

Related questions

Browse Categories

...