Cannot start MongoDB as a service

后端 未结 24 1535
情话喂你
情话喂你 2020-12-07 10:07

I have been developing for MongoDB for some months now and would like to install it as a service on my Windows 7 Enterprise machine. The following is the command that I hav

24条回答
  •  甜味超标
    2020-12-07 10:18

    Another way this might fail is if the account running the service doesn't have write permission into the data directory.

    In that case the service will be unable to create a lock file.

    The mongod service behaves badly in this situation and goes into a loop starting a process, which immediately throws an unhandled exception, crashes, etc. the log file gets recreated every time the process starts up, so you have to grab it quick if you want to see the error.

    the default user for windows services would be localhost\system. so the fix is to ensure this user can write into your db directory, or start the service as another user who can.

提交回复
热议问题