Test target
Test three five condensing ZK, a 5 to shutdown, and then modify 1,2,3 1,2,3 configured, one by one restart will occur if the split brain
Testing process
Preparing 1,2,3,4,5 five, leader 3
to the shutdown. 5
1, the configuration modifications 1, 2, 3, restart
results: 1 follower, leader 3 is a constant
2, 2, 2, 3 configuration changes to
results: 3 is still leader, follower 3 of 3
3, 3 for configuration changes after 1, 2, reboot
2 to become the new leader, follower 3 a.
4, 4, falling, the rest of the cluster [1,2,3]
5, falling, falling 3 to verify the availability of the cluster, create a node, can be used.
in conclusion
A, 5 zk volume reduction of three, steps
. 1, the shutdown 5
2, two non-leader node configuration modification, restart
3, a modified last node, leader or leader node.
4, a machine offline excess
Second, 1,2,3,4 four machines, mainly of the case 3, modify the configuration of 1,2,4, 3 does not change the position of Leader
Third, the suspect, if the cluster is not five, but seven, nine or more, how?
1, each modification is configured to n-1, one by one restart (waste time)
2, the above-described method, the first shutdown few (no more than half), to ensure that [existing node - a new cluster to the minimum number of cluster nodes] <[ original cluster / 2 + 1], so that cracking does not occur brain