ChubbyZookeeper原理及在分布式环境中的应用

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

Chubby&Zookeeper原理及在分布式环境中的应用CodeBox-腾讯Chubby&Zookeeper意义Zookeeper分布式lex&yacc编译谁在用?能干什么?configurationleaderelectionlockinggroupmembershipleasemanagementnameservicesharingbootstrapsessionmanagement特性锁粗粒度分布式文件系统小文件存取通过paxos/zab算法保证最终一致性临时结点自动命名结点事件通知简单易表达高可用松耦合API丰富易扩展数据模型系统集群结构卒将卒卒卒zookeeper读时序followerfollowerfollowerleaderclient12followerzookeeper写时序followerfollowerfollowerleaderclient16follower3245写123456345这几步是类似经典的2PCchubby读时序followerfollowerfollowerleaderclient12chubby写逻辑followerfollowerfollowerleaderclient23这步就是paxos算法的第二步,是引入leaderlease之后对paxo算法的优化。12223334两个漂亮的思路反向通知的实现通过传统的一问一答,实现反向通知读性能平行扩展引用观察者角色美Chubby在bigtable的应用保证bigtable集群只有一个master保存bigtable启动时所需要的数据监控tabletserver及其死活保存Bitable的schemainfo保存ACL其它应用名字服务配置管理用户权限控制序列号分配分布式消息队列启动引导chubbyvszookeeper高性能vs数据一致性PaxosvsZabClientCachevsNoCacheUDPvsTCPpaxos算法(phase1)Aproposerselectsaproposalidnandsendspreparerequestwithidnto½acceptorsIfanacceptorreceivesapreparerequestwithidngreaterthananypreparerequestithasresponded,thenitrespondswithapromisenottoacceptanymoreproposalswithidlessthennandwiththehighestidproposalvaluethatithasacceptedpaxos算法(phase2)Iftheproposerreceives½prepareresponse,itsendsanacceptrequesttoeachofthoseacceptorsforaproposalwithidnandvaluev,wherevisthevalueofthehighestidproposalamongtheresponses,orisanyvalueiftheresponsesreportednoproposalsIfanacceptorreceivesanacceptrequestforaproposalwithidn,itacceptstheproposalunlessithasalreadyrespondedtoapreparerequestwithidgreaterthennPaxos算法演示ABXYZ提案者民主投票者势力、炫耀No.1NO.1NO.1Value1Value1Value1NO.1Value1Paxos算法演示ABXYZNo.1NO.1NO.1No.0No.1No.1NO.0提案者民主投票者势力、炫耀Paxos算法演示ABXYZNo.1NO.1NO.1No.2NO.0NO.2NO.2NO.2Value2Value2Value2Value2提案者民主投票者势力、炫耀Paxos算法演示ABXYZNo.1No.2NO.2NO.2NO.2Value2Value2Value2No.1value1No.2value2提案者民主投票者势力、炫耀Paxos工程优化投票可以阶段可以只把投票请求发给大多数,减少网络交互用lease保证只有一个提案者,则可省略phase1。(不能用在leader选择阶段)THX!

1 / 23
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功