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

查看:54
本文介绍了同一服务器上的多个 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?

推荐答案

上述 answer 不是推荐的方法运行多个实例(尤其是当服务器可能同时运行时),因为它会导致使用相同的配置参数,例如 logpathpidfilepath案例不是您想要的.

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.confmongod-STAGE.conf.在这些文件中,您可能需要提供 dbpathlogpath 文件夹、bind_ipportpidfilepath 特定于每个 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天全站免登陆