一、脑裂概述
# What does "split-brain" mean?
"Split brain" is a condition whereby two or more computers or groups of computers lose contact with one another but still act as if the cluster were intact. This is like having two governments trying to rule the same country. If multiple computers are allowed to write to the same file system without knowledge of what the other nodes are doing, it will quickly lead to data corruption and other serious problems.
脑裂就是集群内各节点间的心跳出现故障,但各节点还处于active状态,多个节点分别接管服务并且写入共享文件资源导致数据损坏或者其它问题。
二、解决办法
小提一下冗余心跳,但是该方式治标不治本,只能减少脑裂发生的概率。
1、踢出集群
(1)Quorum Algorithm
QuorumAlgorithm(选举算法):集群内各节点通过心跳收集彼此的健康状况,收集到一个心跳就获得一票,假设集群内3个节点(A、B、C),节点A获得B和自己一票,节点B获得自己和A一票,而节点C只有自己,则节点C被踢出集群。
(2)Quorum Device
Quorum Algorithm有个缺陷:集群内如果只有2个节点,那就悲剧了。因此ÿ