How to set MongoDB as a windows service

mongodb

Solution

The following works fine for me

mongod --install --serviceName "Mongo DB instance" --serviceDisplayName "Mongo DB instance" --port 27017 --dbpath C:\data --logpath C:\data\1.log --smallfiles

Of course you should change the parameters to fit your needs. Make sure that the appropriate folders exist. After installing the service you start it as follows

net start "Mongo DB instance"

Problem

i am new user of mongodb.I have done the following steps for Installing MongoDB on Windows , Download MongoDB for Windows, Run MongoDB, Start MongoDB, Connect to MongoDB and finally i start mongodb as window service at that time an error is found, when i enter the command "net start mongodb" in command prompt ,the following error is found,: The service is not responding to the control function. How to solve this problem?

Original source