Split brain problem processing Zookeeper cluster - operation and maintenance summary

 

About "split brain" problem clusters, previously here introduced in detail, focus on the following approach Zookeeper split brain problem that the next. Split brain typically occurs in a clustered environment, such as ElasticSearch, Zookeeper clusters, and these clusters have a unified environment feature is that they have a brain, such as the Master node in the cluster is ElasticSearch, Zookeeper cluster nodes have Leader.

A node cluster zookeeper Why deploy into odd
zookeeper fault tolerance means: When the shoot down several zookeeper server node, the number must be greater than the remaining number of shoot down, that is, the rest of the service must be greater than the number of nodes n / 2, so zookeeper cluster can continue to be used, regardless of the number of electoral parity can be leader. For example up to five shoot down node zookeeper machine 2, can continue to be used because the remaining 5/2 to 3 NTU. So why is preferably an odd number of nodes it? Under conditions of maximum number of fault-tolerant servers, it will save resources . For example, the maximum fault tolerance is 2, the corresponding zookeeper number service, an odd number 5, while the even number 6, that is, the case where six zookeeper and services up to shoot down two services, so from the perspective of resource saving point of view, no need to deploy 6 (even) a zookeeper service node.

zookeeper cluster has such a feature: a cluster as long as more than half of the machines are working properly, the entire cluster is available outside. This means that if there are two nodes zookeeper, as long as there is a zookeeper node dies, then the zookeeper service can not be used, because 1 is not more than half, so the death of two zookeeper tolerance is zero; the same token, if there are three a zookeeper, a die, remaining two normal, more than half, so that three zookeeper tolerance of 1; to name a few Similarly you more: 2-> 0; 3-> 1; 4-> 1 ; 5-> 2; 6-> 2 will find a rule, 2n 2n-1, and the tolerance is the same, both n-1, so in order to be more efficient, and that an unnecessary increase why it zookeeper.

Based on the above it can be concluded: From the perspective of saving resources to consider, zookeeper cluster node is best deployed as an odd number! !

Two, zookeeper cluster "split brain" (Split-Brain) Problem
1. What is a split brain?
Simple point, such as when your cluster is there are two nodes, they all know that this cluster was required to elect a master. Then when the communication between the two of them no problem, they will reach a consensus to elect one of them as master. However, if the communication between them is a problem, then the two nodes will feel that now there is no master, so each see themselves elected as the master, so the cluster which will have two master.

 

Three, zookeeper cluster split brain scenarios

 

Guess you like

Origin www.cnblogs.com/kevingrace/p/11801284.html