MongoDB复制分片设置

时间:2014-08-26 13:56:54

标签: mongodb replication sharding

我希望与复制一起进行分割。不要误会我的意思,我设法安装了一个分片集群,可以将复制集作为分片进行访问。

我的问题是如下所示复制分片集群进程:

[ Replication Set 1 ]  <--> [ Replication Set 2 ] <--> [ Replication Set 3 ]
         |                           |                          |
         v                           v                          v
[ Sharded Cluster 1 ]       [ Sharded Cluster 2 ]      [ Sharded Cluster 3 ]
  |                           |                          |             
  |--> [ Shard 1 ]            |--> [ Shard 1 ]           |--> [ Shard 1 ]
  |--> [ Shard 2 ]            |--> [ Shard 2 ]           |--> [ Shard 2 ]
  |--> [ Shard 3 ]            |--> [ Shard 3 ]           |--> [ Shard 3 ]

由于单点故障,我在复制群集分片之上优先使用此设置。当分片群集(例如mongos进程)死亡时,我仍然有2个进程启动并运行。

这种设置是否可行?

1 个答案:

答案 0 :(得分:2)

您要做的事情不起作用。分片和复制总是相反:

[      Sharded Cluster                     ]

[ Shard 1    ] [ Shard 2    ] [ Shard 3    ]
  |              |              |
  |->SetMember   |->SetMember   |->SetMember  
  |->SetMember   |->SetMember   |->SetMember 
  |->SetMember   |->SetMember   |->SetMember 

当您担心mongos进程成为瓶颈和单点故障时,请注意you can have multiple mongos servers accessing the same cluster