OPTIONS
翻译或纠错本页面

生产环境的集群体系结构

在生产环境中,为了保证系统具有较高的可用性,数据必须是冗余的.为了达到这个目的,生产环境中的集群必须有一下的组件:

组件

配置服务器

要有三台 配置服务器 .每一个配置服务器都必须部署在不同的机器上.每个 sharded cluster 必须拥有自己专属的 配置服务器 .意思是,如果你有多个集群,对每个集群都应该有一组配置服务器.

分片

两个或多个 复制集 组成分片,参见 复制 获得关于复制集的更多信息.

分发路由(mongos)

一个或更多的 mongos, mongos 是集群的入口路由,通常,在每个应用服务器上部署一个 mongos.

你也可以部署一组 mongos ,并在应用服务器与 mongos 之间使用负载均衡器或者代理,在这种部署环境下,你 必须 配置你的负载均衡器或代理为 端相关的 ,使来自同一个应用服务器的连接分配到同一个 mongos 上.

因为游标和其他一些资源属于特定的 mongos,每个端必须使用唯一的一个 mongos.

示例

Diagram of a sample sharded cluster for production purposes.  Contains exactly 3 config servers, 2 or more ``mongos`` query routers, and at least 2 shards. The shards are replica sets.

Diagram of a sample sharded cluster for production purposes. Contains exactly 3 config servers, 2 or more mongos query routers, and at least 2 shards. The shards are replica sets.