can we use one arbiter server in two different replica sets of MongoDB?

Posted on

Question :

can we use one arbiter server in two different replica sets of MongoDB?
I had one replica set with
one master
one slave and
one arbiter server

so want to use the same arbiter server in another replica set of different production so can I do the same?

Answer :

Depends, what you mean by “server”. One machine/host – then answer is YES. If you mean the mongod process then answer is NO.

Each Replica Set needs to have a dedicated Arbiter instance. But it is no problem to create several Arbiter mongod services on one machine, just ensure different replSetName and different ports. There service names must differ also, of course.

The Arbiter takes almost no CPU/RAM resources, so it is no issue to run couple of them on one host. Just be aware that each mongod consumes some space on your disc for cache, see cacheSizeGB.

Answer is yes! One physical server can act as an arbiter for two different replica sets, WHEN those arbiters are in different ports.

So, you will start two arbiters with two different config-files and data-directories.

How you will do it (I mean start those processes), it’s your own choice. You can have two systemd etries (with different values) or you have script what starts those two processes.

Leave a Reply

Your email address will not be published. Required fields are marked *