一、设计目标
- 简单(API:create/delete/exists/get data/set data/get children/sync)
- 可复制(内存)
- 有序(tcp/zxid)
- 快速(nio/读写分离)
二、数据结构
三、Znode
- Persistent vs ephemeral
- Sequence
- Watcher
- Stat
e)ACL
四、ACL Permissions
- CREATE
- READ
- WRITE
- DELETE
- ADMIN
- Builtin ACL Schemes
i.world has a single id, anyone, that represents anyone.
ii.auth doesn’t use any id, represents any authenticated user.
iii.digest uses a username:password string to generate MD5 hash which is then used as an ACL ID identity
五、认证auth
- SASL(Kerberos)
- IP
- Digest
- Other plugins
六、存储
- DataTree
- Snapshot
- txnLog
七、运行模式
- Standalone
- Cluster
1.Standalone
2.Cluster
a)Quorum(participate/leader)/Observer/Readonly
b)Status
c)Leader选举
- Major/Hierarchical
- Voting(两两互联,各自统计)
d)Leader确认
- newEpoch/EpochAck
- Sync:DIFF/TRUNC/SNAP
- NEWLEADER/ACK/UPTODATE
e)Leader工作
- PROPOSAL/COMMIT/INFORM
- ACK/PING/REVALIDATE/REQUEST
八、Client
a)命令行
b)zkClient
- 定义了各种listener接口
- serialize接口
- 提供了一些工具及接口
c)Curator
- 动态加载可使用zookeeper服务器
- 超时及重试机制
- Builder封装
- Namespace
- Compress
- background operation