Riken Shah
Riken Shah

Reputation: 3154

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

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 ?

Upvotes: 3

Views: 2065

Answers (1)

scott_lotus
scott_lotus

Reputation: 3275

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.

Upvotes: 2

Related Questions