当前位置:网站首页>ZAB协议
ZAB协议
2022-04-22 07:50:00 【星空下的那个人影】
ZAB协议:是为分布式协调服务Zookeeper专门设计的一种支持崩溃恢复的消息广播协议,实现了分布式数据一致性。
所有的客户端的请求都会写入到Leader进程中,然后由leader进程同步到其他节点,称为Follower。在集群数据同步的过程中,如果出现Follower节点崩溃或者Leader进程崩溃时,需要通过ZAB协议来保证数据一致性。
ZAB协议包括了两种基本的模式:崩溃恢复和消息广播
-
消息广播
集群的所有事务请求都是由Leader节点来处理。当Leader收到请求之后,将请求事务转换为事务Proposal,并且将Proposal分发给集群中其他所有Follower。
完成广播之后,Leader等待Follower的回复。当收到一半以上的Follower回复,Leader将再次向集群中的Follower广播Commit信息。Commit信息就是确认将之前的Proposal提交。
Leader节点写入是两步的操作,第一步是广播事务操作,第二步是广播提交操作。 -
崩溃恢复
a. 初始化集群,刚刚启动的时候;
b. Leader服务器出现了故障宕机
c. Leader服务器与集群中超过半数的节点断联此时开启新的一轮选举,选举产生的Leader与过半的Follower进行同步,使数据一致。当同步结束后,退出恢复模式,进入消息广播模式。
整个Zookeeper集群的一致性保证,就是上面两个状态的切换,当Leader服务正常时,就是正常的消息广播模式;当Leader不可用时,就是进入崩溃恢复模式,崩溃恢复模式会进行数据同步,完成以后,重新进入到消息广播模式。
版权声明
本文为[星空下的那个人影]所创,转载请带上原文链接,感谢
https://blog.csdn.net/sb_jb/article/details/124192023
边栏推荐
- 服务器设置自动开机及定时开机
- C语言实现【关机程序】
- 94. Middle order traversal of binary tree (easy)
- Cesium collects terrain height and model height (asynchronous method, suitable for more data)
- 变量的作用域和生命周期
- Matlab tip: to use 'xxx function', you must authorize, install and enable the following products: XXX toolbox
- The pit encountered in the compilation and installation of pinpoint of win system will be shared with you
- SQL query removes empty data and null fields
- nacos源代码编译中遇到的问题解决后整理如下
- @ data annotation in idea, get / set method does not work
猜你喜欢

Pointer and array (detailed operation)

pycharm

数组传参的本质

Hyperledger Explorer 0.3.9 environment construction

解决磁盘有空间但创建不了文件---修复服务器文件系统

Hyperledger Fabric1. 4 environment construction and example test

Redhat7 configuration yum

Rhel7 logical volume management - Notes

Single page application

xfs 文件系统的备份和恢复(包含磁盘挂载)
随机推荐
el-input输入框输入无效,且Error in data(): “ReferenceError: el is not defined“
tar 源码包管理-源码包安装方法
Android Development - SQLite and sqlitedatabase Application Experiment 6 notes
100. Same tree (easy)
xfs 文件系统的备份和恢复(包含磁盘挂载)
ROM、RAM、SRAM、DRAM、Flash、SDRAM区别
Matlab installation product selection, how to select the products to be installed
聚看点 (详细版) 吃低保 每天几毛 青龙
win10安装Mongo出错Service ‘MongoDB Server’ failed to start
RHEL7 配置本地yum源
express项目将jade模板改为art-template
Tencent video automatic check-in detailed version (V value obtained by multiple methods)
工业缺陷检测项目实战(四)——基于HRNet的陶瓷缺陷检测
Disk management - raid creation
CASE WHEN 及 SELECT CASE WHEN的用法 非常好用
微信小程序手机号码如何进行解密
226. Flip binary tree (easy)
Hyperledger Fabric1.4環境搭建及示例測試
RHEL 用户和组的管理-笔记
mysql导出表的具体字段信息(Navicat客户端详细操作)