ZooKeeper Cluster Description

1. Leader election strategy

Leader election:
•Serverid: Server ID
  For example, there are three servers, numbered 1, 2, and 3 respectively.
  The larger the number, the greater the weight in the selection algorithm.
•Zxid:
  The maximum data ID stored in the data ID server. The larger the value, the newer the data, and the newer the data, the greater the weight in the election algorithm.
• During the Leader election process, if a ZooKeeper gets more than half of the votes, the ZooKeeper can become the Leader.

2. Introduction to the role of the cluster

There are three roles in the ZooKeeper cluster service:
•Leader leader:          
​ 1. Processing transaction requests
​ 2. Scheduler of each server in the cluster (data synchronization, etc.)

•Follower follower:
​ 1. Processing client non-transactional requests, Forward the transaction request to the Leader server
​ 2. Participate in Leader election voting

Observer Observer:
    1. Process the client's non-transactional request and forward the transaction request to the Leader server

Guess you like

Origin blog.csdn.net/u012758488/article/details/129729485