-1

my problem is like. my client has a server where their already system is working and that uses 2.4 MongoDB version. I check I can not upgrade MongoDB. now I create a system for them and that work in version 3 now how do I use two different version of MongoDB in on server?

first of all, I check multiple instances of Mongo DB on same server answer that is different that is for making multiple instances of one MongoDB but my main concern is two different version of one server or PC.

suresh pareek
  • 100
  • 1
  • 12
  • Just install mongodb into two different directories. The rest of the existing answer already applies. – Neil Lunn Jun 15 '17 at 05:38
  • thanks, @NeilLunn now I understand but that is a good thing that this big thing (MongoDB) working only on that directory where that program installed. – suresh pareek Jun 16 '17 at 14:39
  • second, for start MongoDB, I call MongoDB and MongoDB start now with two version of MongoDB how to start specific version of MongoDB?. second, when I start both servers then how can both working in localhost:27017 maybe I have to change port manually. – suresh pareek Jun 16 '17 at 14:42

1 Answers1

1

One option is to run MongoDB in Docker containers. That way, you can have two separate installations of MongoDB, with different versions, and you can guarantee that they won't conflict with each other in any way.

There are images available for several of the more recent versions of MongoDB on dockerhub, or you can build your own docker image - for example if you need to use MongoDB Enterprise.

Vince Bowdren
  • 8,326
  • 3
  • 31
  • 56