定義
balancerStatusバランサーの状態に関する情報を含むドキュメントを返します。
You can only issue the
balancerStatusagainst theadmindatabase.Tip
In
mongosh, this command can also be run through thesh.isBalancerRunning()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 Atlas: The fully managed service for MongoDB deployments in the cloud
MongoDB Enterprise: サブスクリプションベースの自己管理型 MongoDB バージョン
MongoDB Community: ソースが利用可能で、無料で使用できる自己管理型の MongoDB のバージョン
構文
このコマンドの構文は、次のとおりです。
db.adminCommand( { balancerStatus: 1 } )
出力ドキュメント
以下は、 コマンドによって返されるドキュメントの例えです。
{ "mode" : "full", "inBalancerRound" : false, "numBalancerRounds" : Long(86), "ok" : 1 }
フィールド | 説明 |
|---|---|
| バランサー スレッドが実行中か停止かを指定する string。 可能な値は次のとおりです。
|
| バランサー がバランシング ラウンド内かどうかを指定するブール値。
|
| コンフィギュレーションサーバー が起動されて以降に発生した バランサー ラウンドの数。 この値は保持されず、コンフィギュレーションサーバーの再起動時に 0 にリセットされます。 |
例
mongosインスタンスに接続し、次のコマンドを発行します。
db.adminCommand( { balancerStatus: 1 } )