Pages

Friday, February 03, 2012

Installing MongoDB as a Windows Service

In the past, posts with title like this were a real treasure. They usually meant that installing some new technology on a production machine and configuring it to run properly were a real pain. Not to mention performance, stability, and security issues.

Well, seems like those days are well and truly done with. MongoDB natively supports being installed as a Windows service and can easily be done from the command line by passing correct command parameters to mongod. It is as simple as:

mongod --install
mongod --service
mongod --remove
mongod --reinstall

There are additional parameters for setting up service name and credentials but that is really all there is to it. Setting the database path and other options can simply be added to the command line that installs or runs the service, like

mongod --logpath d:\mongo\logs\logfilename.log --logappend --dbpath d:\mongo\data --directoryperdb --install

or

mongod --logpath d:\mongo\logs\logfilename.log --logappend --dbpath d:\mongo\data --directoryperdb --service

For more details check http://www.mongodb.org/display/DOCS/Windows+Service

No comments: