deleteShardFromZone
定義
removeShardFromZone
The
removeShardFromZone
administrative command removes the association between a shard and a ゾーン.Tip
mongosh
では、このコマンドはsh.removeShardFromZone()
ヘルパー メソッドを通じて実行することもできます。ヘルパー メソッドは
mongosh
ユーザーには便利ですが、データベースコマンドと同じレベルの情報は返されない可能性があります。 便宜上必要ない場合、または追加の戻りフィールドが必要な場合は、 データベースコマンドを使用します。
互換性
このコマンドは、次の環境でホストされている配置で使用できます。
MongoDB Atlas はクラウドでの MongoDB 配置のためのフルマネージド サービスです
重要
このコマンドはサーバーレスインスタンスではサポートされていません。 詳細については、「サポートされていないコマンド 」を参照してください。
MongoDB Enterprise: サブスクリプションベースの自己管理型 MongoDB バージョン
MongoDB Community: ソースが利用可能で、無料で使用できる自己管理型の MongoDB のバージョン
構文
You can only run removeShardFromZone
on the admin
database
from a mongos
instance.
このコマンドの構文は、次のとおりです。
db.adminCommand( { removeShardFromZone: <string>, zone: <string> } )
コマンドフィールド
このコマンドは、次のフィールドを使用します。
フィールド | タイプ | 説明 |
---|---|---|
string | The name of the shard from which to remove the ゾーン association. | |
string | The name of the zone whose association with the シャード you want to remove. |
mongosh
provides the helper method
sh.removeShardFromZone()
.
動作
removeShardFromZone
does not remove ranges associated with the
zone.
To completely remove a zone from the cluster, you must run
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 shard key ranges associated with the zone. Use
updateZoneKeyRange
to remove any existing ranges associated with
the zone before running removeShardFromZone
.
シャーディングされたクラスター内のゾーンの詳細については、ゾーンのマニュアル ページを参照してください。
セキュリティ
For sharded clusters that enforce access control, you must authenticate either as:
a user whose privileges include:
update
on theshards
collection in theconfig
database, andfind
on thetags
collection in theconfig
database;
or, alternatively
クラスター リソースで
enableSharding
を含む 権限 を持つユーザー。
The clusterAdmin
or clusterManager
built-in roles have
the appropriate permissions for issuing removeShardFromZone
. See
the ロールベースのアクセス制御 manual page for more
information.
例
The following example removes the association between shard0000
and zone
NYC
:
db.adminCommand( { removeShardFromZone : "shard0000" , zone : "NYC" } )