Mongodb – Cannot start MongoDB as a service

mongodbwindows-services

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 have executed to create the service:

"D:\Milvia Systems\Development\MongoDB\mongod.exe" --logpath "D:\Milvia Systems\Development\MongoDB\logs\DBLog.log" --logappend --dbpath "D:\Milvia Systems\Development\MongoDB\db" -vvv --reinstall

However, whenever I use net start "MongoDB" or the Service Control Panel I receive the following error:

Error 1053: The service did not respond to the start or control
request in a timely fashion.

Environment: Windows 7 Enterprise 64bit
MongoDB: 1.6.3 pdfile version 4.5

Best Answer

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.

Related Topic