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 ?
1 Answers
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).
Deploy 2 installation paths.
Start the application using:
mongod --port 12345
(where 12345 is the port you specified) To start the exe on a different port.
Default port is 27017 if port not specified in the command.
See http://docs.mongodb.org/manual/tutorial/manage-mongodb-processes/
Example:
Deploy:
C:\mongo1\bin\mongod.exe
C:\mongo1\data\
C:\mongo2\bin\mongod.exe
C:\mongo2\data\
Execute:
start /b c:\mongo1\bin\mongod --dbpath "c:\mongo1\data" --port 27017
start /b c:\mongo2\bin\mongod --dbpath "c:\mongo2\data" --port 27050
When connecting using MONGO.exe be sure to specify port to connect to correct instance.

- 1
- 1

- 3,171
- 22
- 51
- 69
-
All you need is 2 x copies of the BIN directory. C:\mongo1\bin\mongod.exe C:\mongo2\bin\mongod.exe Then simply execute each individual MONGOD.EXE with the PORT flag. – scott_lotus Jun 25 '15 at 06:23
-
22 interesting things: 1) poster asked about Ubuntu, but you answered for Windows 2) why poster accepted answer for Windows – Askar Jun 25 '15 at 09:35