问题描述
我已经安装了mongod 3.0.4.我遵循了此处中的步骤.我还想安装mongo 2.6.10,因为我的项目之一正在使用它.如何安装两个版本,以便可以使用其中一个?
I have mongod 3.0.4 installed. I followed the steps from here. I also want to install mongo 2.6.10 as one of my project uses it. How can I have two versions installed so that I can use either one ?
推荐答案
您可以在同一主机上运行多个mongoDB版本,只要这些版本作为通用规则不在同一副本集中即可(根据您的问题判断)没问题).
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).
部署2条安装路径.
使用以下命令启动应用程序:
Start the application using:
(其中12345是您指定的端口)要在其他端口上启动exe.
(where 12345 is the port you specified)To start the exe on a different port.
如果未在命令中指定端口,则默认端口为27017.
Default port is 27017 if port not specified in the command.
请参见 http://docs.mongodb.org/manual/tutorial/manage-mongodb-processes/
示例:
C:\ mongo1 \ data \
C:\mongo1\data\
C:\ mongo2 \ bin \ mongod.exe
C:\mongo2\bin\mongod.exe
C:\ mongo2 \ data \
C:\mongo2\data\
执行:
开始/b c:\ mongo2 \ bin \ mongod --dbpath"c:\ mongo2 \ data"-端口27050
start /b c:\mongo2\bin\mongod --dbpath "c:\mongo2\data" --port 27050
使用MONGO.exe连接时,请确保指定端口以连接到正确的实例.
When connecting using MONGO.exe be sure to specify port to connect to correct instance.
这篇关于如何在Ubuntu 12.04中安装两个版本的mongodb parallely?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!