I'm not talking about sharding. We had a testing server (linux) and there is already one mongo which belongs to another project/subteam. Is it possible to run multiple, isolated instances of mongodb on one machine? How can I do it?
|
|
||||
|
|
|
Yes, you can do this by specifying different port numbers and data directories for the other instances of For example:
You can also change the shard server and config server port numbers if you need to. |
|||||||||||||
|
|
The steps I've taken are:
Replaced /var/lock/subsys/mongod with /var/lock/subsys/mongod2 (mongod3, respectively) wherever I found it. Resist the temptation to replace mongod.lock with mongod2.lock (or to mongod3.lock, respectively). They are in different folders (database folders are different) and won't conflict. Now I can
and also
for each mongo instance (remember the port settings from the conf files) I am not aware of any side effect of renaming the mongod binary.. Hope this helps. [Later edit] To start the instances automatically, just ln -s /etc/init.d/mongod2 /etc/rc.d/rc3.d/S86mongod and ln -s /etc/init.d/mongod3 /etc/rc.d/rc3.d/S87mongod :) |
||||
|