Reputation: 48909
In the replica set architecture article the suggested (minimum) configuration is made of: one primary member and two secondary ones (or one secondary and a lightweight arbiter). Hence two voting members.
However few lines below you can read (this is for having "smooth elections"):
When adding additional members, ensure the following architectural conditions are true:
The set has an odd number of voting members.
If you have an even number of voting members, deploy an arbiter to create an odd number.
If I'm right two is even, that is the suggested minimal configuration is wrong! How an even number of voters can cause elections that are "not smooth"? What's "not smooth" in terms of voting in the replica?
More on this: even counting the primary as voter (thus three voters, odd number) if the primary goes down you'll end up with two voters. How the primary can vote if it's down?
Upvotes: 2
Views: 1522
Reputation: 42352
In the replica set architecture article the suggested (minimum) configuration is made of: one primary member and two secondary ones (or one secondary and a lightweight arbiter). Hence two voting members.
This is incorrect. Primary, secondary and arbiter is THREE votes.
Therefore you have an odd number of votes. Therefore if one node is down the other two are a majority and can elect a new primary.
The reason you shouldn't have an even number is so that in case of a network partition you won't end up with 50% of voting members on each side of the network partition - if that happened you would have no primary even if every member of the replica set is actually up.
Upvotes: 1