rs.stepDown() in MongoDB replication
It instructs the primary of the replica set to become a secondary. After the primary steps down,the eligible secondaries will hold an election for primary.
Generally, the rs.stepDown() does not immediately step down the primary. If no electable secondaries are up to date with the primary, the primary waits up to secondaryCatchUpPeriodSecs (by default 10 seconds) for a secondary to catch up. Once an electable secondary is available, the method steps down the priamry.
Once stepped down, the original primary becomes a secondary and is ineligible from becoming primary again for the remainder of time specified by stepDownSecs.
The rs.stepDown() method attempts to terminate long-running user's operations that block the primary from stepping down, such as an index build, a write operation, or a map-reduce job.
Syntax: rs.stepDown(stepDownSecs, secondaryCatchUpPeriodSecs)
Comments
Post a Comment