- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
Chubby Zookeeper原理及在分布式环境中的应用
CodeBox-腾讯
Chubby Zookeeper 意义
Zookeeper
分布式
lexyacc
编译
谁在用?
能干什么?
configuration
leader election
locking
group membership
lease management
name service
sharing
bootstrap
session management
特性
锁
粗粒度
分布式文件系统
小文件存取
通过paxos/zab算法保证最终一致性
临时结点
自动命名结点
事件通知
简单
易表达
高可用
松耦合
API丰富
易扩展
数据模型
系统集群结构
卒
将
卒
卒
卒
zookeeper读时序
follower
follower
follower
leader
client
1
2
follower
zookeeper写时序
follower
follower
follower
leader
client
1
6
follower
3
2
4
5
写 123 456
3 4 5 这几步是类似经典的2PC
chubby读时序
follower
follower
follower
leader
client
1
2
chubby写逻辑
follower
follower
follower
leader
client
2 3 这步就是paxos算法的第二步,是引入leader lease 之后对paxo算法的优化。
1
2
2
2
3
3
3
4
两个漂亮的思路
反向通知的实现
通过传统的一问一答,实现反向通知
读性能平行扩展
引用观察者角色
美
Chubby在bigtable的应用
保证bigtable集群只有一个master
保存bigtable启动时所需要的数据
监控tablet server及其死活
保存Bitable的schema info
保存ACL
其它应用
名字服务
配置管理
用户权限控制
序列号分配
分布式消息队列
启动引导
chubby vs zookeeper
高性能 vs 数据一致性
Paxos vs Zab
Client Cache vs No Cache
UDP vs TCP
paxos算法 (phase 1)
A proposer selects a proposal id n and sends prepare request with id n to ½ acceptors
If an acceptor receives a prepare request with id n greater than any prepare request it has responded, then it responds with a promise not to accept any more proposals with id less then n and with the highest id proposal value that it has accepted
paxos算法 (phase 2)
If the proposer receives ½ prepare response, it sends an accept request to each of those acceptors for a proposal with id n and value v, where v is the value of the highest id proposal among the responses, or is any value if the responses reported no proposals
If an acceptor receives an accept request for a proposal with id n, it accepts the proposal unless it has already responded to a prepare request with id greater then n
Paxos算法演示
A
B
X
Y
Z
提案者
民主
投票者
势力、炫耀
No.1
NO.1
NO.1
Value1
Value1
Value1
NO.1
Value1
Paxos算法演示
A
B
X
Y
Z
No.1
NO.1
NO.1
No.0
No.1
No.1
NO.0
提案者
民主
投票者
势力、炫耀
Paxos算法演示
A
B
X
Y
Z
No.1
NO.1
NO.1
No.2
NO.0
NO.2
NO.2
NO.2
Value2
Value2
Valu
原创力文档


文档评论(0)