Cannot start MongoDB as a service

后端 未结 24 1524
情话喂你
情话喂你 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:35

    Have your checked you logging to see the real problem?

    I suggest extracting the Mongo installation to c:\mongodb.

    Create the c:\mongodb\logs and the c:\mongodb\data\db directories.

    Then browse the the c:\mongodb\bin directory and run the following to remove the service (if you've installed it!):

    mongod --remove
    

    Then install the service, specifying the log and data directories:

    mongod --logpath c:\mongodb\logs\mongo.log --dbpath c:\mongodb\data\db --directoryperdb --install
    

    Then if there is a problem starting the service you should see the reason in the specified log file.

    More info here.

提交回复
热议问题