Replica Sets with Four or More Members¶
Although the standard replica set configuration has three members you can deploy larger sets. Add additional members to a set to increase redundancy or to add capacity for distributing secondary read operations.
When adding members, ensure that:
The set has an odd number of voting members. If you have an even number of voting members, deploy an arbiter so that the set has an odd number.
The following replica set needs an arbiter to have an odd number of voting members.
The following 9 member replica set has 7 voting members and 2 non-voting members.
For instance, some members that have limited resources or networking constraints and should never be able to become primary. Configure members that should not become primary to have priority 0. In following replica set, the secondary member in the third data center has a priority of 0:
A majority of the set’s members should be in your applications main data center.
|||While replica sets are the recommended solution for production, a replica set can support only 12 members in total. If your deployment requires more than 12 members, you’ll need to use master-slave replication. Master-slave replication lacks the automatic failover capabilities.|