同一台服务器上的Mongo DB的多个实例 [英] multiple instances of Mongo DB on same server

查看:63
本文介绍了同一台服务器上的Mongo DB的多个实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在与Mongo DB合作,我是它的新手.我即将将其安装在专门用于Mongo的服务器上.

I am working with Mongo DB and I am a newbie to it. I am about to install it on a server specifically for Mongo.

我想创建2个实例-1个支持QA环境,另一个支持暂存环境.

I would like to create 2 instances of it - 1 to support a QA environment, the other to support a Staging Environment.

我更熟悉SQL Server,可以在其中创建多个实例.

I am more familiar with SQL Server where I can create multiple instances.

是否可以对Mongo DB进行同样的操作?如果可以,怎么办?

Is it possible to do the same with Mongo DB and if so, how?

推荐答案

不建议使用上述答案运行多个实例(尤其是当服务器可能同时运行时),因为这将导致使用相同的配置参数,例如 logpath pidfilepath 案件不是您想要的.

The aforementioned answer is not a recommended way to run multiple instances (especially when the servers might be running at the same time) as it will lead to usage of the same config parameters like for example logpath and pidfilepath which in most cases is not what you want.

请考虑创建专用的mongod配置文件,例如 mongod-QA.conf mongod-STAGE.conf .在这些文件中,您可能需要提供 dbpath logpath 文件夹, bind_ip port pidfilepath 特定于每个mongod实例,并且不会互相影响.

Please, consider creating dedicated mongod configuration files like mongod-QA.conf and mongod-STAGE.conf. In these files you may want to provide dbpath, logpath folders, bind_ip, port and pidfilepath specific to each mongod instance and that will not affect each other.

完成这些步骤后,您可以按如下所示触发两个实例

After these steps you are good to trigger two instances as follows

mongod --config <path-to>/mongod-QA.conf
mongod --config <path-to>/mongod-STAGE.conf

您可以在mongodb文档的页面

You can find more details on mongodb docs page

这篇关于同一台服务器上的Mongo DB的多个实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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