Learning Zookeeper - Help me with example -
i'm trying wrap head around zookeeper , does. point, experience zookeeper has been through other libraries require zookeeper (solr , kafka) , basic understand vague "you better use zookeeper keep configuration straight".
so me think through simple example problem. let's build own service "stuff". there 2 things want protect:
- i want have little downtime possible (gotta keep doing stuff).
- i can not have more 1 server doing stuff because bad things happen.
so, how set in zookeeper? zookeeper responsible starting stuff server if 1 goes down? or subscribe zookeeper "stuff doer status" callback? if erroneously start 2 stuff servers, how zookeeper me keep bad things happening?
zookeeper distributed lock manager. these systems provide features coordinator election (aka "master election" or "leader election") distributed system, provide consistent, distributed access small amounts of critical information used configuration (i.e., don't treat database or general file system).
note zookeeper not manage service, can use zookeeper keep hot standby (or several) such in case of 1 master failing, 1 take over, run n replicas of servers, such 1 of working instances can take on if current leader goes down or becomes unavailable reason.
using master election, can choose have 2 (or more) servers, 1 of them able take master lock, 1 able take action. goes away, lose claim lock, , hot standby pick lock , start doing work need do. @ zookeeper recipes code samples. however, handing off work, checkpointing, , general service resilience still design , implement.
that said, zookeeper , similar systems provide solid foundation enable build robust distributed systems.
other systems similar zookeeper include (alphabetically):
several of these have detailed comparisons written on respective websites show how differ others in list.
Comments
Post a Comment