当前位置:网站首页>Raft agreement
Raft agreement
2022-07-03 14:13:00 【Grab】
For strong ⼀ Consensus algorithm , At present, the most used is Raft agreement .
Raft Implementation cases of mature protocols
- Ant gold JRaft;
- Zookeeper Of ZAB;
- Consul Of Raft;
- Baidu braft;
- Apache Of Ratis;
Raft role
- follower (Follower): Ordinary people , Silently receiving and receiving messages from leaders , When the leader's heartbeat message times out , I'll take the initiative to stand up , Recommend yourself as a candidate .
- The candidate (Candidate): Candidates will ask other nodes to vote RPC news , Inform other nodes to vote , If you win a majority of the votes , Just be promoted to be a leader .
- The leader (Leader): Handle write requests 、 Manage log replication and constantly send heartbeat information ( Maintain leadership ).
Random timeout characteristics
Raft The algorithm has the characteristics of random timeout , The timeout interval of each node waiting for the heartbeat information of the leader node is random . To prevent multiple nodes from voting at the same time , The election timeout allocated by each node is also random .
The election process
- The initial state , All nodes are followers .
- When there is no leader in the cluster , The node with the smallest waiting timeout will not wait for the leader's heartbeat , Timeout occurred .
- Overtime self recommendation , At this point, the node will add its own tenure number , And recommend yourself as a candidate , Vote for yourself first , Then send a request to vote to other nodes RPC news , Ask them to elect themselves leaders .
- The election vote , Other nodes receive the candidate's RPC When the news , And numbered 1 Term of office , Have you ever voted for , Then vote for the candidate , Then add your term number .
- New leaders emerge , The candidate won a majority of the votes during the election timeout , Then it will be the new leader of this term .
- The normal state , Leaders will periodically send heartbeat messages to other services .

边栏推荐
- Uniapp tips - scrolling components
- QT learning 19 standard dialog box in QT (top)
- QT learning 17 dialog box and its types
- npm install卡住与node-npy的各种奇怪报错
- Redis:字符串类型数据的操作命令
- 1px problem of mobile terminal
- 7-8 overspeed judgment
- FPGA测试方法以Mentor工具为例
- Interface for querying IP home
- 金属有机骨架MIL-88负载阿霉素DOX|叶酸修饰UiO-66-NH2负载阿霉素[email protected]纳米粒子
猜你喜欢

关于回溯问题中的排列问题的思考(LeetCode46题与47题)

Solution to failure or slow downloading of electron when electron uses electron builder to package

Failure of vector insertion element iterator in STL

Leetcode (4) - - trouver la médiane de deux tableaux ordonnés positifs

protobuf与grpc

小项目(servelt+jsp+mysql+EL+JSTL)完成一个登录功能的Servlet,具有增删改查的操作。实现登录身份验证,防止非法登录,防止多点登录,记住用户名密码功能。

Fabric. JS document

Leetcode (4) -- find the median of two positively ordered arrays

Print. JS -- web page file printing

Polestar美股上市:5.5万台交付如何支持得起超200亿美元估值
随机推荐
关于回溯问题中的排列问题的思考(LeetCode46题与47题)
[clean up the extraordinary image of Disk C]
JS general form submission 1-onsubmit
QT learning 20 standard dialog box in QT (middle)
7-7 12-24 hour system
556. 下一个更大元素 III
jvm-运行时数据区
Exercise 9-3 plane vector addition
[ACNOI2022]猜数
Doxorubicin loaded on metal organic framework MIL-88 DOX | folic acid modified uio-66-nh2 doxorubicin loaded [email
Comprehensive evaluation of good-looking, easy-to-use and powerful handwriting note taking software: notability, goodnotes, marginnote, handwriting, notes writers, collanote, collanote, prodrafts, not
Uniapp skills - scrolling components -1
Interface for querying IP home
Dlopen() implements dynamic loading of third-party libraries
MongoDB索引
UiO-66-COOH装载苯达莫司汀|羟基磷灰石( HA) 包裹MIL-53(Fe)纳米粒子|装载黄芩苷锰基金属有机骨架材料
3D vision - 2 Introduction to pose estimation - openpose includes installation, compilation and use (single frame, real-time video)
常见问题之PHP——ldap_add(): Add: Undefined attribute type in
jvm-对象生命周期
Implementation of Muduo asynchronous logging