定義
balancerStartバランサー スレッドを開始します。 コマンドはバランシング ラウンドが開始されるのを待ちません。
MongoDB 7.0 以降では、バランサーを起動すると、シャーディングされたクラスターの AutoMerger も有効になります。
Tip
In
mongosh, this command can also be run through thesh.startBalancer()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 のバージョン
構文
You can only issue the balancerStart against the admin database on a mongos instance.
このコマンドの構文は、次のとおりです。
db.adminCommand( { balancerStart: 1, maxTimeMS: <number> } )
コマンドフィールド
フィールド | タイプ | 説明 |
|---|---|---|
| any | 任意の値。 |
| integer | 任意。 バランサーを有効にするための時間制限。 デフォルトは 60000 ミリ秒です。 |
例
バランサー スレッドを開始するには、 mongosインスタンスに接続して次のコマンドを発行します。
db.adminCommand( { balancerStart: 1 } )