定義
sh.removeShardFromZone(shard, zone)ゾーンとシャードの間の関連付けを削除します。
重要
mongosh メソッド
This page documents a
mongoshmethod. This is not the documentation for database commands or language-specific drivers, such as Node.js.データベースコマンドについては、
removeShardFromZoneコマンドを参照してください。MongoDB API ドライバーについては、各言語の「MongoDB ドライバーのドキュメント」を参照してください。
このメソッドには次のパラメーターがあります。
Parameterタイプ説明string
The name of the shard from which to remove the zone association.
string
The name of the zone whose association with the shard you want to remove.
Only issue
sh.removeShardFromZone()when connected to amongosinstance.
互換性
このメソッドは、次の環境でホストされている配置で使用できます。
- MongoDB Atlas はクラウドでの MongoDB 配置のための完全管理サービスです
重要
このコマンドは、M0 および Flex クラスターではサポートされていません。詳細については、サポートされていないコマンド を参照してください。
MongoDB Enterprise: サブスクリプションベースの自己管理型 MongoDB バージョン
MongoDB Community: ソースが利用可能で、無料で使用できる自己管理型の MongoDB のバージョン
動作
sh.removeShardFromZone() は、ゾーンに関連付けられた範囲を削除しません。
To completely remove a zone from the cluster, you must run sh.removeShardFromZone() on each shard associated with the zone.
If the shard specified is the last shard associated with the zone, you must ensure there are no remaining ranges associated with the zone. Use updateZoneKeyRange to remove any existing ranges associated to the zone before running sh.removeShardFromZone().
シャーディングされたクラスター内のゾーンの詳細については、ゾーンのマニュアル ページを参照してください。
バランサー
ゾーンとシャードの間の関連付けを削除すると、シャード上のゾーンによってカバーされるチャンクを維持する制約が削除されます。 次のバランサー ラウンド中に、バランサーは以前にゾーンによってカバーされていたチャンクを移行する場合があります。
シャーディングされたクラスターで移行がどのように機能するかについて詳しくは、 シャーディングされたクラスター バランサーのマニュアル ページを参照してください。
セキュリティ
アクセス制御を強制するシャーディングされたクラスターの場合は、次のいずれかとして認証する必要があります。
クラスター リソースで
enableShardingを含む 権限 を持つユーザー。
The clusterAdmin or clusterManager built-in roles have the appropriate permissions for issuing sh.removeShardFromZone(). See the Role-Based Access Control manual page for more information.
例
次の例では、 shard0000とNYCゾーン間の関連付けを削除します。
sh.removeShardFromZone("shard0000", "NYC")