Docs Menu

sh.stopBalancer()

sh.stopBalancer(timeout, interval)

バージョン 6.1 での変更

Disables the balancer in a sharded cluster.

MongoDB 6.0.3以降、 自動チャンク分割は実行されません。 これはバランシング ポリシーの改善によるものです。 自動分割コマンドは引き続き存在しますが、操作は実行されません。

In MongoDB versions earlier than 6.0.3, sh.stopBalancer() also disables auto-splitting for the sharded cluster.

重要

mongosh メソッド

このページでは、mongosh メソッドについて記載しています。ただし、データベースコマンドや Node.js などの言語固有のドライバーのドキュメントには該当しません

データベースコマンドについては、balancerStop コマンドを参照してください。

MongoDB API ドライバーについては、各言語の MongoDB ドライバー ドキュメントを参照してください。

メソッドは次のオプションを取ることができます。

Parameter
タイプ
説明

timeout

integer

Optional. Time limit for disabling the balancer.

デフォルトは 60000 ミリ秒です。

interval

integer

Optional. The interval (in milliseconds) at which to check if the balancing round has stopped.

If you omit both options, MongoDB disables the balancer indefinitely.

重要

バランサーを長期間無効のままにすると、シャードのバランスが取れず、クラスターのパフォーマンスが低下する可能性があります。 必要な場合のみバランサーを無効にし、メンテナンスが完了した後にバランサーを再度有効にするようにします。

インスタンスではのみsh.stopBalancer() mongosを実行できます。sh.stopBalancer()mongod{ インスタンスで実行すると エラーが発生します。

The mongosh shell method is a wrapper around the balancerStop command.

このメソッドは、次の環境でホストされている配置で使用できます。

  • MongoDB Atlas はクラウドでの MongoDB 配置のためのフルマネージド サービスです

重要

このコマンドは、M0 、M2 、M5 、および Flex クラスターではサポートされていません。詳細については、「 サポートされていないコマンド 」を参照してください。

  • MongoDB Enterprise: サブスクリプションベースの自己管理型 MongoDB バージョン

  • MongoDB Community: ソースが利用可能で、無料で使用できる自己管理型の MongoDB のバージョン

If a balancing round is in progress, the operation waits for balancing to complete.