구성 샤드
MongoDB 8.0 부터는 일반적인 샤딩된 클러스터 메타데이터 외에 애플리케이션 데이터를 저장 하도록 config 서버 를 구성할 수 있습니다. config 서버 와 샤드 서버 기능을 모두 제공하는 mongod
노드 를 config 샤드 라고 합니다. 샤드 서버 기능 없이 독립형 --configsvr
로 실행되는 mongod
노드 를 전용 config 서버 라고 합니다.
A sharded cluster must have a config server, but it can be either a config shard (embedded config server) or a dedicated config server. Using a config shard reduces the number of nodes required and can simplify your deployment. A config shard cluster is also called an embedded config server cluster. You cannot use the same config server for multiple sharded clusters.
사용 사례
클러스터 에 3개 이하의 샤드가 있는 경우 config 샤드 사용을 고려할 수 있습니다.
애플리케이션 에 까다로운 가용성 및 복원력 요구 사항이 있는 경우 전용 config 서버 를 배포하는 것이 좋습니다. 전용 config 서버 는 중요한 클러스터 작업을 위한 격리, 전용 리소스 및 일관적인 성능을 제공합니다.
You should use a dedicated config server if you satisfy one or more of the following conditions:
You plan to use more than three shards.
You plan to use Time series collections or Queryable Encryption collections.
You plan to use queryable backups (on-prem).
행동
In an embedded config server cluster, a config shard will be used to store cluster metadata and user data. It helps reduce the complexity of a sharded cluster deployment.
You can store sharded and unsharded collection data in your config shard. It has all the properties of a shard as well as acting as the config server.
구성 샤드 ID 문서
config 서버 를 config 샤드 로 식별하려면 admin.system.version
컬렉션 의 문서 를 검사합니다. 이 예시 에서는 shardName
이 'config'
로 설정하다 됩니다.
{ _id: 'shardIdentity', shardName: 'config', clusterId: ObjectId("<objectID>"), configsvrConnectionString: '<config server replica set connection string>', }
다음 예시 에서는 관리 데이터베이스 의 admin.system.version
에서 샤드 ID 문서 를 검색합니다.
use admin db.system.version.find()
출력 추출:
{ _id: 'shardIdentity', shardName: 'config', clusterId: ObjectId("6441bdd6779584849dcac095"), configsvrConnectionString: 'configRepl/localhost:27007' }
명령.
전용 config 서버 를 config 샤드 로 실행 하도록 구성하려면 transitionFromDedicatedConfigServer
명령을 실행 합니다.
전용 config 서버 로 실행 config 샤드 를 구성하려면 transitionToDedicatedConfigServer
명령을 실행 합니다.