Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MongoDb arbiter can be used with multiple replicaSets?

If I have different webpages for differents countries and each webpage have a mongodb replicaSet of 2-3 nodes, can I use an arbiter with more than one replicaSet so it votes in all?

Or I need to initiate an arbiter per replicaSet?

like image 918
Wiliam Avatar asked Aug 26 '12 11:08

Wiliam


People also ask

How does arbiter work in MongoDB?

Arbiters are mongod instances that are part of a replica set but do not hold data (i.e. do not provide data redundancy). They can, however, participate in elections. Arbiters have minimal resource requirements and do not require dedicated hardware.

What is the main purpose of the arbiter?

The Arbiter acts as the primary enemy of the game, charged with the destruction of humanity by the Prophet of Regret. He is ultimately killed by human forces at the game's climax.

What is the maximum number of nodes in a MongoDB replica set?

MongoDB supports replica sets, which can have up to 50 nodes.

What is the maximum number of member instances a replica set can have in MongoDB replication before version 3.0 0?

A replica set can have up to 50 members but only 7 voting members.


1 Answers

You can have multiple arbiter processes running on a single server (different ports). They are quite lightweight in terms of resources, as all they are doing is voting. You should look into starting the arbiters with the following arguments to keep them as lightweight as possible (from the Command Line Parameters Page):

  • --smallfiles - Use a smaller initial file size (16MB) and maximum size (512MB)
  • --nojournal - Disable journaling. In v2.0+, journaling is on by default for 64-bit

If you do not run with those options, then the arbiter will still work, but will pre-allocate data files before it knows that it is an arbiter.

Update (Jan 2018): Since this answer was written official guidance has been added to the docs for startup options of an arbiter, including options in the new config format. It can be found here.

like image 197
Adam Comerford Avatar answered Oct 08 '22 08:10

Adam Comerford