ZooKeeper
Wait-free coordination for Internet-scale systems
Patrick Hunt and Mahadev (Yahoo! Grid) Flavio Junqueira and Benjamin Reed (Yahoo! Research)
ZooKeeper Wait-free coordination for Internet-scale systems Patrick - - PowerPoint PPT Presentation
ZooKeeper Wait-free coordination for Internet-scale systems Patrick Hunt and Mahadev (Yahoo! Grid) Flavio Junqueira and Benjamin Reed (Yahoo! Research) Internet-scale Challenges Lots of servers, users, data FLP, CAP Mere mortal
Patrick Hunt and Mahadev (Yahoo! Grid) Flavio Junqueira and Benjamin Reed (Yahoo! Research)
Master Slave Slave Slave Slave Slave Slave
Master Slave Slave Slave Slave Slave Slave Coordination Service Master
Master Slave Slave Slave Slave Slave Slave Coordination Service Master
Worker Worker Worker Worker Worker Worker Coordination Service
String create(path, data, acl, flags) void delete(path, expectedVersion) Stat setData(path, data, expectedVersion) (data, Stat) getData(path, watch) Stat exists(path, watch) String[] getChildren(path, watch) void sync() Stat setACL(path, acl, expectedVersion) (acl, Stat) getACL(path)
/ services users apps locks workers YaView s-1 worker2 worker1
/ services users apps locks workers YaView s-1 worker2 worker1 Ephemerals created by Session X Sequence appended
config settings
workers worker2 worker1
workers worker2 worker1 If a watch is triggered for “.../workers/leader”, followers will restart the leader election process leader
locks x-19 x-11 x-20 Each znode watches one other. No herd effect.
locks x-19 s-11 x-20 x-19 x-19 s-21 x-22 s-20
ZooKeeper Service Server Server Server Server Server Server
change
We need 2f+1 machines to tolerate f failures
ZooKeeper Service Server Server Server Server Server Server Client Client Client Client Client Client Client Client
Leader