Mongodb,分片和多个Windows服务 [英] Mongodb, sharding and multiple windows services

查看:142
本文介绍了Mongodb,分片和多个Windows服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了使分片工作,我需要运行mongod.exe的两个副本.一台作为分片,一台作为配置服务器.如何将两个mongod实例都安装为Windows服务?

In order to get sharding to work I need to run two copies of mongod.exe. One as a shard and one as the config server. How can I install both mongod instances as windows services?

推荐答案

以下命令行将安装Mongo DB的第二个实例.请注意,您必须提供 serviceName serviceDisplayName port dbpath logpath 为了避免冲突.

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实例" --serviceDisplayName" Mongo DB 2nd instance " --port 37017 --dbpath c:\ data \ db2 --logpath c:\ data \ logs \ mongolog2.txt

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

然后您只需使用

net start" Mongo DB 2nd实例"

这篇关于Mongodb,分片和多个Windows服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆