Three Member Replica Sets
The minimum architecture of a replica set has three members. A threemember replica set can have either three members that hold data, ortwo members that hold data and an arbiter.
Primary with Two Secondary Members
A replica set with three members that store data has:
These deployments provide two complete copies of the data set at alltimes in addition to the primary. These replica sets provideadditional fault tolerance and high availability. If the primary is unavailable, the replicaset elects a secondary to be primary and continues normaloperation. The old primary rejoins the set when available.
Primary with a Secondary and an Arbiter
A three member replica set with a two members that store data has:
- One primary.
- One secondary member. Thesecondary can become primary in an election.
- One arbiter. The arbiter onlyvotes in elections.
Since the arbiter does not hold a copy of the data, these deploymentsprovides only one complete copy of the data. Arbiters require fewerresources, at the expense of more limited redundancy and faulttolerance.
Note
For the following MongoDB versions, pv1
increases the likelihoodof w:1
rollbacks compared to pv0
(no longer supported in MongoDB 4.0+) for replica sets with arbiters:
- MongoDB 3.4.1
- MongoDB 3.4.0
- MongoDB 3.2.11 or earlier
See Replica Set Protocol Version.
However, a deployment with a primary, secondary, and an arbiterensures that a replica set remains available if the primary or thesecondary is unavailable. If the primary is unavailable, the replicaset will elect the secondary to be primary.
See also