Can't start mongodb service

帅比萌擦擦* 提交于 2019-11-30 13:38:32

问题


I just instaled mongo 3. And tried to run it as windows server but receive error

The MongoDB 3.0 service terminated with the following service-specific error: 
Cannot create another system semaphore.

Can't find any info about that error and mongodb.


回答1:


Check mongodb logs. In my case mongodb could not find directory from mongod.cfg




回答2:


In my case it appered to be mongod.lock issue after unexpected shutdown.

Detected unclean shutdown - E:\MongoDb\Databases\mongod.lock is not empty.

I deleted E:\MongoDb\Databases\mongod.lock and mongo successfuly started.




回答3:


This happened for me a couple times because my Mac crashed which resulted in unclean shutdown of Parallels and my Mongo instance. mongod.lock was not empty.

This was on a development server so I didn't have backups. I was able to repair by using

mongod --repair --repairpath <path to your mongo data>

More instructions here




回答4:


After installing the .msi on Windows 10 in Program Files, I created the service for a different data location C:\Mongo\Data\DB

The Service installed correctly but didn't start with error "Cannot create another system semaphore" because:

I hadn't created the required folder structure. Simple as that - d'oh!

Hope this helps someone.




回答5:


In Windows:

there is an effective method to solve this issue.

Firstly, try to delete the file storage.bson under the folder "D:\mongodb\data", or the corresponding path in your PC.

If the issue still exists, try following steps in order.

For example mongoDB version 3.6 is installed, and the install path of MongoDB is "D:\Program Files\MongoDB".

Create folder D:\mongodb\logs, then create file mongodb.log inside this folder.

Run cmd.exe as administrator,

D:\Program Files\MongoDB\Server\3.6\bin>taskkill /F /IM mongod.exe
D:\Program Files\MongoDB\Server\3.6\bin>mongod.exe --logpath D:\mongodb\logs\mongodb.log --logappend --dbpath D:\mongodb\data --directoryperdb --serviceName MongoDB --remove
D:\Program Files\MongoDB\Server\3.6\bin>mongod --logpath "D:\mongodb\logs\mongodb.log" --logappend --dbpath "D:\mongodb\data" --directoryperdb --serviceName "MongoDB" --serviceDisplayName "MongoDB" --install

Remove these two files mongod.lock and storage.bson under the folder "D:\mongodb\data".

Then type net start MongoDB in the cmd using administrator privilege, the issue will be solved.




回答6:


Also check permissions for dbpath and logpath. In my case I had configured mongo as a service running as Network Service, but, hadn't given Network Service write access to those directories.




回答7:


In case this helps anyone else, for me it was that I had started mongod.exe manually in a command prompt window so the windows service couldn't run mongod.exe on the same port already in use. Doh!




回答8:


I had the same problem and in my case the config was wrong. This error from event viewer is not very helpful and mostly confusing so everyone should check mongo logs first.




回答9:


Didn't have enough space on disc C: where MongoDB was installed. After making some space -- mongod.exe successfully started.




回答10:


In my case, another instance of MongoDB was running in command prompt on the same port.




回答11:


For me, on a fresh install of MongoDB v4.0.3 on Windows 10 Pro, the install failed to start the mongo service at the end.

Trying to start mongod from the command prompt, pointed to the correct mongodb.cfg config, gave me the error:

Unrecognized option: mp

I ripped open the config and searched for "mp", to find the last 2 lines of the file:

#snmp:
mp:

I threw a # in front of that last line and tried again, and the service started fine.

¯\_(ツ)_/¯



来源:https://stackoverflow.com/questions/30143414/cant-start-mongodb-service

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!