How to deal with zookeeper node downtime?

Alibaba cloud Q & A 2022-02-13 06:01:31 阅读数:90

deal zookeeper node downtime

Zookeeper How are node outages handled ?




Take the answer 1:

Zookeeper It's also a cluster , The recommended configuration is no less than 3 Servers .Zookeeper We also need to ensure that when a node goes down , Other nodes will continue to provide services .

If it's a Follower Downtime , also 2 Servers provide access , because Zookeeper There are multiple copies of the data on , Data is not lost ;

If it's a Leader Downtime ,Zookeeper New ones will be elected Leader.

ZK The mechanism of clustering is that as long as more than half of the nodes are normal , The cluster can provide services normally . Only in ZK Too many nodes , Only half or less of the nodes can work , Clusters fail .

therefore

3 Of nodes cluster You can hang up 1 Nodes (leader You can get 2 ticket >1.5)

2 Of nodes cluster You can't hang up on anything 1 There are nodes (leader You can get 1 ticket <=1)


copyright:author[Alibaba cloud Q & A],Please bring the original link to reprint, thank you. https://en.javamana.com/2022/02/202202130601304890.html