user2626222
user2626222

Reputation: 169

Mongodb Sharded cluster with replica sets

I have 8 linux servers and would like to setup a sharded cluster with replica sets. If I want the replication factor to be 1, How many replica sets should I create?

Or any other better way to do this? I am a newbie and looking for a better setup.

Thanks.

Upvotes: 0

Views: 272

Answers (1)

Andrei Beziazychnyi
Andrei Beziazychnyi

Reputation: 2917

  1. You should have at least three nodes in replica set, otherwise you would have election issues in case of failure
  2. You could use arbiter as third node and place it on the same server where another mongodb instance is running. It doesn't require a lot of resources
  3. At max you could have 4 replica set where secondary and primary are on different servers and arbiters share machines with another mongodb instances from different replica set
  4. Real number of required replica set depends on your data load, how many writes and reads you have per second, and on your servers. To make decision you should measure performance of your servers against data load and make informed decision. At least you could benchmark your servers.

Upvotes: 1

Related Questions