Installing multiple versions of MongoDB on Linux

How can we set up multiple MongoDB versions on Ubuntu 16.04?

MongoDB 3.4.1 is already up and running on my system and wanted to set up MongoDB 2.6 for another application. Since our application running on MongoDB 2.6 has a DB driver that is incompatible with MongoDB 3.4, we need to run the MongoDB version on the same Linux server.

Tried following the link below but failed.

+3


source to share


1 answer


To do this, you must have both versions of MongoDB available on your system.

For example, let's say you downloaded the 2.6 binaries to /opt/mongo/26/

and the other version to /opt/mongo/34/

, you can run both versions of the database daemon on different ports:



/opt/mongo/26/mongod --dbpath /data/26/ --port 27017
/opt/mongo/34/mongod --dbpath /data/34/ --port 28018

      

+2


source







All Articles