Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot start MongoDB as a service

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

like image 645
Martin Reich Avatar asked Jan 11 '11 19:01

Martin Reich


People also ask

Can not start MongoDB service?

We found that the reason for this error was the dbpath variable in /etc/mongodb. conf. Previously, the default value for dbpath was /data/db. The upstart job mongodb(which comes with mongodb-10gen package) invokes the mongod with –config /etc/mongodb.

Why is mongod not working?

This error comes because after installing the MongoDB database we also need to set the path of MongoDB in the system environment variable. So to resolve this error you need to follow the below steps: Open that folder where you install MongoDB. Open MongoDB folder till bin folder where mongod.exe file and copy the path.


1 Answers

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.

like image 150
Ciaran Archer Avatar answered Sep 19 '22 17:09

Ciaran Archer