简体   繁体   English

如何在Ubuntu 12.04中并行安装两个版本的mongodb?

[英]How can I install two versions of mongodb parallely in Ubuntu 12.04 ?

I have mongod 3.0.4 installed. 我安装了mongod 3.0.4。 I followed the steps from here . 我按照这里的步骤。 I also want to install mongo 2.6.10 as one of my project uses it. 我也想安装mongo 2.6.10,因为我的一个项目使用它。 How can I have two versions installed so that I can use either one ? 如何安装两个版本以便我可以使用其中一个版本?

You can run multiple mongoDB version on the same host as long as these version are not in the same Replica Set as a general rule (which judging by your question will not be a problem). 您可以在同一主机上运行多个mongoDB版本,只要这些版本与一般规则不在同一个副本集中(根据您的问题判断不会出现问题)。

Deploy 2 installation paths. 部署2个安装路径。

Start the application using: 使用以下命令启动应用

mongod --port 12345 mongod --port 12345

(where 12345 is the port you specified) To start the exe on a different port. (其中12345是您指定的端口)在另一个端口上启动exe。

Default port is 27017 if port not specified in the command. 如果未在命令中指定端口,则默认端口为27017。

See http://docs.mongodb.org/manual/tutorial/manage-mongodb-processes/ http://docs.mongodb.org/manual/tutorial/manage-mongodb-processes/

Example: 例:

Deploy: 部署:

C:\\mongo1\\bin\\mongod.exe C:\\ mongo1 \\ BIN \\ mongod.exe

C:\\mongo1\\data\\ C:\\ mongo1 \\数据\\

C:\\mongo2\\bin\\mongod.exe C:\\ mongo2 \\ BIN \\ mongod.exe

C:\\mongo2\\data\\ C:\\ mongo2 \\数据\\

Execute: 执行:

start /bc:\\mongo1\\bin\\mongod --dbpath "c:\\mongo1\\data" --port 27017 start / bc:\\ mongo1 \\ bin \\ mongod --dbpath“c:\\ mongo1 \\ data”--port 27017

start /bc:\\mongo2\\bin\\mongod --dbpath "c:\\mongo2\\data" --port 27050 start / bc:\\ mongo2 \\ bin \\ mongod --dbpath“c:\\ mongo2 \\ data”--port 27050

When connecting using MONGO.exe be sure to specify port to connect to correct instance. 使用MONGO.exe连接时,请确保指定连接到正确实例的端口。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM