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

后端 未结 1 635
傲寒
傲寒 2021-01-14 10:07

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 tha

1条回答
  •  不思量自难忘°
    2021-01-14 10:22

    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.

    0 讨论(0)
提交回复
热议问题