0

I want to get sharding up together with replication. Don't get me wrong, I managed to install a sharded cluster that accesses replication sets as shards.

My problem is to get the sharded cluster processes replicated just like this:

[ 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 ]

I'd prefere this setup above replicating cluster shards due to the single point of failure. When sharded cluster (e.g. the mongos process) dies, then I still got 2 processes up and running.

Is this kind of setup possible in any way?

bash0r
  • 774
  • 6
  • 17
  • Its reverse. Shards are primary partitions of database, then there are replications of these partitions. – S.D. Aug 26 '14 at 14:34

1 Answers1

2

What you are trying to do doesn't work. Sharding and replicating always works the other way around:

[      Sharded Cluster                     ]

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

When you worry about the mongos process being a bottleneck and single point of failure, note that you can have multiple mongos servers accessing the same cluster.

Philipp
  • 67,764
  • 9
  • 118
  • 153