定義
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
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.
互換性
このコマンドは、次の環境でホストされている配置で使用できます。
MongoDB Enterprise: サブスクリプションベースの自己管理型 MongoDB バージョン
MongoDB Community: ソースが利用可能で、無料で使用できる自己管理型の MongoDB のバージョン
重要
このコマンドは、MongoDB Atlas クラスターではサポートされていません。すべてのコマンドに対する Atlas のサポートについては、「サポートされていないコマンド」を参照してください。
構文
このコマンドの構文は、次のとおりです。
db.runCommand( { replSetFreeze: <seconds> } )
動作
指定した秒数が経過する前にレプリカセット ノードの固定を解除する場合は、 0の 秒値を指定して コマンドを発行できます。
db.runCommand( { replSetFreeze: 0 } )
mongodプロセスを再起動すると、レプリカセット メンバーの固定も解除されます。
replSetFreeze is an administrative command, and you must issue it against the admin database.