Navigation
This version of the manual is no longer supported.

rs.stepDown()

rs.stepDown(seconds)
Parameters:
  • seconds (init) – Specify the duration of this operation. If not specified the command uses the default value of 60 seconds.
Returns:

disconnects shell.

Forces the current replica set member to step down as primary and then attempt to avoid election as primary for the designated number of seconds. Produces an error if the current node is not primary.

This function will disconnect the shell briefly and forces a reconnection as the replica set renegotiates which node will be primary. As a result, the shell will display an error even if this command succeeds.

rs.stepDown() provides a wrapper around the database command replSetStepDown.

←   rs.status() rs.syncFrom()  →