説明
sh.setBalancerState(state)MongoDB 6.0.3以降、 自動チャンク分割は実行されません。 これはバランシング ポリシーの改善によるものです。 自動分割コマンドは引き続き存在しますが、操作は実行されません。
In MongoDB versions earlier than 6.0.3,
sh.setBalancerState()also enables auto-splitting if enabling the balancer and disables auto-splitting if disabling the balancer.バランサーが現在有効か無効かを確認するには
sh.getBalancerState()を使用し、その現在の状態を確認するにはsh.isBalancerRunning()を使用します。重要
mongosh メソッド
This page documents a
mongoshmethod. This is not the documentation for database commands or language-specific drivers, such as Node.js.データベースコマンドについては、
balancerStartコマンドとbalancerStopコマンドを参照してください。MongoDB API ドライバーについては、各言語の「MongoDB ドライバーのドキュメント」を参照してください。
重要
You can only run
sh.setBalancerState()on amongosinstance.sh.setBalancerState()errors if run onmongodinstance.The
sh.setBalancerState()method has the following parameter:
互換性
このメソッドは、次の環境でホストされている配置で使用できます。
- MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud
重要
This command is not supported in M0 and Flex clusters. For more information, see Unsupported Commands.
MongoDB Enterprise: サブスクリプションベースの自己管理型 MongoDB バージョン
MongoDB Community: ソースが利用可能で、無料で使用できる自己管理型の MongoDB のバージョン