Definição
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.Dica
In
mongosh, this command can also be run through thers.freeze()helper method.Helper methods are convenient for
mongoshusers, 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.
Compatibilidade
Esse comando está disponível em implantações hospedadas nos seguintes ambientes:
MongoDB Enterprise: a versão autogerenciada e baseada em assinatura do MongoDB
MongoDB Community: uma versão com código disponível, de uso gratuito e autogerenciada do MongoDB
Importante
Este comando não é aceito em clusters do MongoDB Atlas. Para obter informações sobre o suporte do Atlas a todos os comandos, consulte Comandos não suportados.
Sintaxe
O comando tem a seguinte sintaxe:
db.runCommand( { replSetFreeze: <seconds> } )
Comportamento
Se quiser descongelar um membro do conjunto de réplicas antes que o número especificado de segundos tenha decorrido, você pode emitir o comando com um valor de segundos de 0:
db.runCommand( { replSetFreeze: 0 } )
Reiniciar o processo mongod também descongela um membro do conjunto de réplicas.
replSetFreeze is an administrative command, and you must issue it against the admin database.