OPTIONS
翻译或纠错本页面

集群组件

Sharded clusters implement sharding. A sharded cluster consists of the following components:

分片

分片是存储了一个集合部分数据的MongoDB实例,每个分片是单独的 mongod 或者是 replica set .在生产环境中,所有的分片都应该是复制集.参见 分片 获得更多信息.

配置服务器

每个:ref:配置服务器 <sharding-config-server>`都是存储了集群元信息的 :program:`mongod.元信息存储了 数据块 对分片的映射,参见 配置服务器.获得更多信息.

分发路由

每个路由都是 mongos ,它将读写请求分发到分片中.应用并不直接访问分片.参见 集群的查询路由分发 获得更多信息.

Diagram of a sharded cluster.

Diagram of a sharded cluster.

MongoDB中分片的基本单位是集合,对每个开启了分片的集合,都可以设置一个 shard key .

Further Reading

分片
A shard is a mongod instance that holds a part of the sharded collection’s data.
配置服务器
Config servers hold the metadata about the cluster, such as the shard location of the data.

部署集群,请参见 部署一个集群.

←   分片概念介绍 分片  →