6
votes

I am unable to start my mongoDB after an unclean system shutdown. There is a mongod.lock with a size of 1 KB. I want to delete this file and then repair the mongoDB. I deleted the file and tried the command

mongod --dbpath "%ProgramData%\mongodb\data\db" --repair

But I am getting an error message...

I STORAGE [initandlisten] exception in initAndListen: 72 Requested option conflicts with current storage engine option for directoryPerDB; you requested false but the current server storage is already set to true and cannot be changed, terminating.....

Please assist...

1
I think you used --directoryperDB. Try adding that to your command mongod --dbpath "%ProgramData%\mongodb\data\db" --directoryPerDB --repair - BruceWayne
Adding --directoryperDB worked.. Thanks Krishna - Nishad Azeez
How to run the above command "mongod --dbpath "%ProgramData%\mongodb\data\db" --repair" from a folder other than the mongodb installation folder.. When I tried "start "C:\Program Files\mongodb\mongod.exe" --dbpath "%ProgramData%\Schneider Electric\SchneiderTools\data\db" --directoryperdb --repair" ... I get a message "windows cannot find--dbpath" - Nishad Azeez
Path sould not contain spaces, check Schneider Electric in above mentioned path - BruceWayne
It's now --directoryperdb (all lowercase) - jtlz2

1 Answers

1
votes

Try to add --directoryperDB like this:

mongod --dbpath "%ProgramData%\mongodb\data\db" --directoryPerDB