3

I often shutdown my comp with my MongoDB running...this is an improper shutdown and then I have to go delete the lockfile when I start up mongod again. What is the point of this lockfile? Can I just disable it for this case? Is it harmful for me to shut down in this way?

PinkElephantsOnParade
  • 6,452
  • 12
  • 53
  • 91

2 Answers2

2

The purpose of lock file is to help recover from the unexpected shutdown Here and here

Community
  • 1
  • 1
Ravi Khakhkhar
  • 1,924
  • 1
  • 18
  • 25
1

You should run MongoDB as a service, that way when you shutdown the OS it will stop the MongoDB service cleanly and your problem will go away. You don't mention what OS you are using but if on Linux, take a look at this page:

http://docs.mongodb.org/manual/tutorial/install-mongodb-on-debian-or-ubuntu-linux/

If on Windows take a look here:

http://www.mongodb.org/display/DOCS/Windows+Service

For OS X, you can either use port/brew or roll your own control scripts.

Adam Comerford
  • 21,336
  • 4
  • 65
  • 85