Mongodb windows service config install#
The work around for this issue to simply to install the config file in a path without spaces, such as "c:\mongo\nf". When installing MongoDB as a Windows Service, if the nf file is located in a path with spaces the service. Note that the -config value is NOT quoted even though it was quoted on the command line when the service was installed. "c:\mongo\bin\mongod.exe" -config c:\program files\mongo\nf -service The MongoDB service’s launching command path is stored in Windows Registry at the following path: HKEYLOCALMACHINE\SYSTEM\CurrentControlSet\services\MongoDB\ImagePath The configuration path is set as the -config argument of the launching command, e.g.: C:\server\mongodb\bin\mongod.exe -config 'C:\server\mongodb\cfg\mongod.cfg' -service. Inspecting the ImagePath key in the registry at HKLM/System/CurrentControlSet/services/MongoDB/ImagePath reveals the following value: Referring to the earlier mongoDB post, below is the steps to start the mongdb service. We can start a service of MongoDB so that the service will be running in the background. Errors in System log from the Service Control Manager include "A timeout was reached (30000 milliseconds) while waiting for the Mongo DB service to connect" and "The Mongo DB service failed to start due to the following error: The service did not respond to the start or control request in a timely fashion." Running MongoDB as a service in Windows: We can start the mongoDB service either using the mongod command using it in command prompt. To do this, enter the path where you installed MongoDB. By doing this, the database is always active and you can use it. By creating this service, every time your Windows is launched, the MongoDB server is also launched as a Windows service. In this section you need to create a MongoDB service. d:\mongodb\bin> mongod -config D:\mongodb\nfig -install A Windows service named MongoDB is created. Step 5: Create the mongod.cfg configuration file. Install as Windows Service with -install. You'll receive "The service is not responding to the control function". Add MongoDB as Windows Service, so that MongoDB will start automatically following each system restart. To install mongodb windows service, use the following command in Command Prompt as Administrator 'C:MongoDBbinmongod.exe' -config 'C:MongoDBmongod. > mongod.exe -config "c:\Program Files\mongo\nf" -installĢ) Attempt the start the MongoDB service using net start Inspecting the ImagePath in the registry reveals that the -config path is not quoted correctly.ġ) Install MongoDB as a service using the following command 1) On server 1, navigate to the C:MongoDB directory and create a new folder named conf and within that directory a file called nf. When installing MongoDB as a Windows Service, if the nf file is located in a path with spaces the service will not start correctly. These are the steps for installing MongoDB as a Windows Service.