Mongodb – Error while running mongo server

mongodb

I am totally a beginner with mac , I get this error while trying to open the server using mongod
10309 Unable to create/open lock file: /data/db/mongod.lock errno:13 Permission denied Is a mongod instance already running?, terminatin

Best Answer

The error usually indicates that the lock file is still present from a previous run. That means that the mongod process is stil running, check:

ps auxwww | grep mongod

If it is not listed, then remove the lock file and start mongod again. If it is listed and unresponsive you may have to kill the process (assuming you cannot connect). Try a regular kill before a kill -9 etc.

If the process is not there, or you kill it successfully, remove the lock file and restart mongod - if you had journaling enabled everything should be fine. If not, you may need the repair operation suggested by Sean.

Related Topic