정의
removeShardFromZoneThe
removeShardFromZoneadministrative command removes the association between a shard and a zone.팁
In
mongosh, this command can also be run through thesh.removeShardFromZone()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: 클라우드에서의 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> } )
명령 필드
이 명령은 다음 필드를 사용합니다.
필드 | 유형 | 설명 |
|---|---|---|
문자열 | The name of the shard from which to remove the zone association. | |
문자열 | The name of the zone whose association with the shard you want to remove. |
mongosh provides the helper method sh.removeShardFromZone().
행동
removeShardFromZone 구역과 관련된 범위는 제거하지 않습니다.
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.
샤드 클러스터의 구역에 대한 자세한 내용은 구역 매뉴얼 페이지를 참조하세요.
보안
액세스 제어 를 적용하는 샤드 cluster의 경우 다음 중 하나를 사용하여 인증해야 합니다.
클러스터 리소스에 대한 가
enableSharding포함된 권한을 가진 사용자입니다.
The clusterAdmin or clusterManager built-in roles have the appropriate permissions for issuing removeShardFromZone. See the Role-Based Access Control manual page for more information.
예시
다음 예에서는 shard0000 와 구역 NYC 간의 연결을 제거합니다.
db.adminCommand( { removeShardFromZone : "shard0000" , zone : "NYC" } )