Mongodb, sharding and multiple windows services

蹲街弑〆低调 提交于 2019-11-28 05:32:15

The following command line will install a 2nd instance of Mongo DB. Note that you have to provide serviceName, serviceDisplayName, port, dbpath and logpath in order to avoid collisions.

mongod --install --serviceName "Mongo DB 2nd instance" --serviceDisplayName "Mongo DB 2nd instance" --port 37017 --dbpath c:\data\db2 --logpath c:\data\logs\mongolog2.txt

Then you just start the service with

net start "Mongo DB 2nd instance"

Use sc.exe from the Windows Resource Kit ( http://support.microsoft.com/kb/251192 ) which allows you to specify an unique display name for each instance:

sc.exe create "Mongo DB 1" binPath= "c:\mongodb\bin\mongod.exe --service --dbpath=c:\data\db --logpath=c:\data\log.txt"

Mongo added a --serviceDisplayName flag in 1.8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!