Configure MongoDB Service on Windows

Configure MongoDB service on Windows

1. Create the configuration file:

echo logpath=D:\mongodb\log\mongod.log > “D:\MongoDB\mongod.cfg”
echo dbpath=D:\mongodb\data >> “D:\MongoDB\mongod.cfg”

2. Crate the scheduler task on windows services.msc
sc.exe create MongoDB binPath= “\”D:\MongoDB\bin\mongod.exe\” –service –config=\”D:\MongoDB\mongod.cfg\”” DisplayName= “MongoDB 2.6 Standard” start= “auto”

3. Start the MongoDB from the windows Service
net start MongoDB

D:\mongodb>net start MongoDB
The service is not responding to the control function.
More help is available by typing NET HELPMSG 2186.

Check all the folder is created or not present in mongod.cfg file.
I skip to create log folder. I created it and start again.

D:\mongodb>net start MongoDB
The MongoDB 2.6 Standard service is starting.
The MongoDB 2.6 Standard service was started successfully.

4. net stop MongoDB

You can check the log fie also : “D:\MongoDB\mongod.cfg”


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.