
Raft简述
AppendEntries RPC RequestVote RPC ������ ������ RPC ��������������������������������� ������������������������������������ RPC��� ��������������������������������� ������������������������������������������ ������������������������������������������������������������ ��������������������������� ��������������������������������������������������������������������������� ��������������������� ������������������������ ������ Follower��� ������ ������ ������������������������ ��������������������� ������������������������������������������������������������������������������������������������������ ��������������� ������������������������������������������������������������ ������������������������������������������������������������������������������������������ Follower/Candidate ������������������������������������������������ RPC��������������������������� ������������������������������������������������������������������������������������������������������������������ ������������������������������������������������������������������������������������������������������������
发布日期:2021-05-10 01:23:27
浏览次数:20
分类:精选文章
本文共 4111 字,大约阅读时间需要 13 分钟。
Raft���������������������������������������������������������������������������������������Multi-Paxos������������������������������Leader���������������������������������������Raft���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
������
������
������ | ������ | ��������� |
---|---|---|
currentTerm | ���������������������������������������0��������������� | ������ |
VoteFor | ���������������������������������������ID������������null��� | ������ |
log[] | ���������������������������command, term���������������1������ | ������ |
commitIndex | ������������������������������������������0��������������� | ��������� |
lastApplied | ���������������������������������������������������0��������������� | ��������� |
nextIndex[] | ��������������������������������������������������������������������� | ��������������������� |
matchIndex[] | ������������������������������������������������������������������0��������������� | ��������������������� |
RPC������
- ���������������������������������������������������������������������������������
- ������������������������������������������
���������������
���������������
commitIndex > lastApplied
��������� lastApplied
������������������������������ log[lastApplied]
���T
������ currentTerm
������������ currentTerm
��� T
��������������������������������� "Follower"���Follower���������������
electionTimeout
������������������������������������������ AppendEntries
RPC ������������������������������������������������������������Candidate���������������
- ������
currentTerm
��� - ������������������
- ������������������������
- ������������������������
RequestVote
RPC���
AppendEntries
RPC��������������������������� "Follower" ���������Leader���������������
- ������������������������������
AppendEntries
RPC��������������� - ������������������������������������������������
- ������������������������������������������������������������
- ������ Follower ���
lastApplied
������������������������������������������nextIndex
���������������AppendEntries
RPC ������nextIndex
��������������������� - ���������������
nextIndex
���matchIndex
��� - ���������������������������������������������������
nextIndex
������������������
commitIndex
��������������������������������������������� - ������������
N
���������N > commitIndex
matchIndex[i] >= N
���������������������������log[N].term == currentTerm
���
���������������
��������������������������� "Follower"���Follower ������������������������������ electionTimeout
���������������������������������
currentTerm
��������������� "Candidate"���RequestVote
RPC���- ������������������������
- ������������������������������������ "Follower"���
- ���������������������������������������������������������������������������
������������
- ������������������������������������������������
- ������������������������������������������
���������
������������������
���������������������Raft ������������������������������������������������������������������������������������������������
发表评论
最新留言
关注你微信了!
[***.104.42.241]2025年04月22日 14时20分22秒
关于作者

喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
力扣-81题(Java)
2021-05-10
力扣-344题(Java)
2021-05-10
windows快捷键隐藏桌面所有窗口——“老板键”
2021-05-10
Ubuntu进入超级用户提示“认证失败”
2021-05-10
微信自定义分享ios无效
2021-05-10
this.$router.push不起作用(this指向错误)
2021-05-10
Sublime安装px转rem插件
2021-05-10
retrofit --post请求
2021-05-10
typora 行内公式不识别
2021-05-10
IDEA上传Jar
2021-05-10
多线程应用场景
2021-05-10
Spring 应用程序有哪些不同组件?
2021-05-10
饮食男女观后感
2021-05-10
SpringBoot工程临时加一个分页的yml文件没有生效
2021-05-10
MySQL常见错误锦囊
2021-05-10
搭建的SpringMVC项目,404错误,确保代码正确的前提,可能是jar包没导进去
2021-05-10
iOS中常用的宏定义总结
2021-05-10
js简单实现验证码
2021-05-10
javaweb笔记
2021-05-10