Cannot start MongoDB as a service

Martin Reich picture Martin Reich · Jan 11, 2011 · Viewed 112.1k times · Source

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

Answer

Ciaran Archer picture Ciaran Archer · Jan 11, 2011

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.