Mongodb error: how can I make sure your log directory is installed

I typed mongod on 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 can I make sure my log directory is installed? Will you be able to solve this problem?

+6
source share
5 answers

You have an unclean shutdown. You must run mongod with the --repair option.

 mongod --repair 

Please note that after repair you need to restart mongod

+15
source

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

To check if this directory is a mount point, use mountpoint /data/db/ . But I do not think that is the reason.

/data/db/mongod.lock exist when mongod is started and destroyed when mongod stops. This means that for some reason, an abnormal shutdown.

You must remove mongod.lock , then issue mongod --repair .

+2
source

For 32Bit you need to use this

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

I got the message "Unclean shutdown detected - / data / db / mongod.lock is not empty." and google search led me to this question - however my problem was different.

I was on mac and I ran $ mongod when I had to run $ sudo mongod

0
source

1. remove mongo.lock

2. Mongod -dbpath path --repair

3.mongod path --dbpath

Run the command with administrator access. I was on the Windows desktop.

0
source

Source: https://habr.com/ru/post/986093/


All Articles