mongodb error: how do I make sure that your journa

2020-08-26 18:05发布

问题:

I typed mongod on in my mac terminal and got the following error:

2015-04-27T22:11:46.471-0400 W -        [initandlisten] Detected unclean  shutdown - /data/db/mongod.lock is not empty.
2015-04-27T22:11:46.479-0400 I STORAGE  [initandlisten] ************** 
old lock file: /data/db/mongod.lock.  probably means unclean shutdown,
but there are no journal files to recover.
this is likely human error or filesystem corruption.
please make sure that your journal directory is mounted.
found 4 dbs.
see: http://dochub.mongodb.org/core/repair for more information

How do I make sure my journal directory is mounted? Will that solve the problem?

回答1:

You have an unclean shutdown. You should start mongod with --repair option.

mongod --repair

Note that after repair you will need to restart mongod



回答2:

1.delete mongo.lock

2.Mongod --dbpath path --repair

3.mongod --dbpath path

Run command with Admin accesss.I had sloved in Windows machine.



回答3:

Journal is stored in the path specified in --dbpath option. In your case /data/db/.

To check if this directory is a mountpoint, use mountpoint /data/db/. But I don't think it is the cause.

/data/db/mongod.lock exist when mongod starts, and destroyed when mongod shutdown. It's existence means improper shutdown, for whatever reason.

You should remove mongod.lock, then issue a mongod --repair.



回答4:

For 32Bit you need to use this

    mongod --storageEngine=mmapv1 --dbpath [your-path] --repair


回答5:

I received the message "Detected unclean shutdown - /data/db/mongod.lock is not empty." and a google search brought me to this question - however my problem was different.

I was on a mac and I ran $ mongod when I should have run $ sudo mongod



标签: mongodb