当前位置:网站首页>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 .

边栏推荐
- JS general form submission 1-onsubmit
- C language,%d% Difference between 2D%2d%02d
- Qt学习21 Qt 中的标准对话框(下)
- Toast UI editor (editor allows you to edit your markup document using text or WYSIWYG, with syntax highlighting, scrolling synchronization, real-time preview and chart functions.)
- FPGA测试方法以Mentor工具为例
- QT learning 20 standard dialog box in QT (middle)
- Uniapp skills - dom display and hiding
- 28:第三章:开发通行证服务:11:在配置文件中定义属性,然后在代码中去获取;
- Message subscription and publishing
- Onmenusharetimeline custom shared content is invalid, and the title and icon are not displayed
猜你喜欢

泰凌冲刺科创板:拟募资13亿 国家大基金与小米长江是股东

NFT新的契机,多媒体NFT聚合平台OKALEIDO即将上线

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

Exercise 6-1 classify and count the number of characters

7-11 calculation of residential water charges by sections

28: Chapter 3: develop Passport Service: 11: define attributes in the configuration file, and then obtain them in the code;
[email protected])|制备路线"/>叶酸修饰的金属-有机骨架(ZIF-8)载黄芩苷|金属有机骨架复合磁性材料([email protected])|制备路线
![Mysql:insert date:sql error [1292] [22001]: data truncation: incorrect date value:](/img/2f/33504391a661ecb63d42d75acf3a37.png)
Mysql:insert date:sql error [1292] [22001]: data truncation: incorrect date value:

JS Part III

556. 下一个更大元素 III
随机推荐
x86汇编语言-从实模式到保护模式 笔记
金属有机骨架MOFs装载非甾体类抗炎药物|ZIF-8包裹普鲁士蓝负载槲皮素(制备方法)
JS matrix zero
Implementation of Muduo asynchronous logging
交联环糊精金属有机骨架负载甲氨蝶呤缓释微粒|金属-有机多孔材料UiO-66负载黄酮苷类药物|齐岳
Exercise 8-8 moving letters
Why are grass-roots colleges and universities with "soil and poverty" called "Northeast small Tsinghua"?
MIL-100( Fe) 包裹小分子阿司匹林形成[email protected](Fe)|甘草次酸修饰金属有机框架材料UiO-66-NH2(简称UiO-66-NH2-GA)
Programmable logic device software testing
Installation impression notes
Leetcode(4)——尋找兩個正序數組的中比特數
How to delete an attribute or method of an object
JVM class loading
剑指 Offer 28. 对称的二叉树
关于回溯问题中的排列问题的思考(LeetCode46题与47题)
Exercise 9-1 time conversion
Common mixins
信创产业现状、分析与预测
QT learning 23 layout manager (II)
7-11 calculation of residential water charges by sections