replSetFreezeThe
replSetFreezecommand prevents a replica set member from seeking election for the specified number of seconds. Use this command in conjunction with thereplSetStepDowncommand to make a different node in the replica set a primary.Tip
In the
mongoShell, this command can also be run through thers.freeze()helper method.Helper methods are convenient for
mongousers, but they may not return the same level of information as database commands. In cases where the convenience is not needed or the additional return fields are required, use the database command.The
replSetFreezecommand uses the following syntax:{ replSetFreeze: <seconds> } If you want to unfreeze a replica set member before the specified number of seconds has elapsed, you can issue the command with a seconds value of
0:{ replSetFreeze: 0 } Restarting the
mongodprocess also unfreezes a replica set member.replSetFreezeis an administrative command, and you must issue it against the admin database.