Add an Arbiter to Replica Set¶
mongod instances that are part of a
replica set but do not hold data. Arbiters participate in
elections in order to break ties.
If a replica set has an even number of members, add an arbiter.
Arbiters have minimal resource requirements and do not require dedicated hardware. You can deploy an arbiter on an application server or a monitoring host.
Do not run an arbiter on the same system as a member of the replica set.
For replica sets with an arbiter, replica set protocol version 1
pv1) increases the likelihood of rollback of
w:1 writes compared to replica set protocol version 0
pv0). See Replica Set Protocol Versions.
An arbiter does not store data, but until the arbiter’s
process is added to the replica set, the arbiter will act like any other
mongod process and start up with a set of data files and with a
To minimize the default creation of data, set the following in the arbiter’s configuration file:
falseon a data-bearing node.
For MMAPv1 storage engine,
Add an Arbiter¶
Create a data directory (e.g.
storage.dbPath) for the arbiter. The
mongodinstance uses the directory for configuration data. The directory will not hold the data set. For example, create the
Start the arbiter, specifying the data directory and the replica set name. The following starts an arbiter using the
rsfor the replica set name:
mongod --port 30000 --dbpath /data/arb --replSet rs
Connect to the primary and add the arbiter to the replica set. Use the
rs.addArb()method, as in the following example:
This operation adds the arbiter running on port