OPTIONS

Replica Set High AvailabilityΒΆ

Replica sets provide high availability using automatic failover. Failover allows a secondary member to become primary if the current primary becomes unavailable.

Changed in version 3.2: MongoDB introduces a version 1 of the replication protocol (protocolVersion: 1) to reduce replica set failover time and accelerates the detection of multiple simultaneous primaries. New replica sets will, by default, use protocolVersion: 1. Previous versions of MongoDB use version 0 of the protocol. To upgrade existing replica sets to use protocolVersion: 1, see Upgrade a Replica Set to 3.2.

Replica set members keep the same data set but are otherwise independent. If the primary becomes unavailable, an eligible secondary holds an election to elect itself as a new primary. In some situations, the failover process may undertake a rollback. [1]

The deployment of a replica set affects the outcome of failover situations. To support effective failover, ensure that one facility can elect a primary if needed. Choose the facility that hosts the core application systems to host the majority of the replica set. Place a majority of voting members and all the members that can become primary in this facility. Otherwise, network partitions could prevent the set from being able to form a majority.

[1]Replica sets remove “rollback” data when needed without intervention. Administrators must apply or discard rollback data manually.

Was this page helpful?

Yes No

Thank you for your feedback!

We're sorry! You can Report a Problem to help us improve this page.