Apache ZooKeeper - Mesosphere
Apache ZooKeeper - Mesosphere
service
● Hierarchical namespace mail
void sync(path)
List<OpResult> multi(ops)
ZooKeeper Service
ZooKeeper Service
Leader
5. goto step 1
Each Node:
1. Create /nodes/node-${i} as ephemeral nodes
2. Keep updating /nodes/node-${i} periodically for node status changes (status
updates could be load/iostat/cpu/others)
Work Queues
Assigner process:
1. Watch /tasks for published tasks
2. Pick tasks on watch trigger from /tasks /tasks
3. assign it to a machine specific queue
by creating
create(/machines/m-${i}/task-${j})
4. Watch for deletion of tasks task-1 task-2 task-3
(task completed)
Machine process:
1. Machines watch for /(/machines/m-${i})
for any creation of tasks
/machines
2. After executing task-${i} delete task-${i}
from /tasks and /m-${i}
m-1
task-1
Ensemble Size?
What's the right size for the ensemble?
● 1 - standalone, no reliability
● 3 - allows for one failure
● 5 - optimal for online production serving
Performance Numbers.
Maintenance
● Minimal
○ Ensure that you clean the datadir (autopurge
added in 3.4)
● The rest is automatic
○ e.g. servers bootstrap from the Leader
Monitoring Tools
● Command port (four letter words - 4lw)
● JMX
● slf4j/log4j logging
HTTP/JSON:
● Jetty is in 3.5.x - ZOOKEEPER-1346
Where are we?
● Multi Tenant
● Observers
● Recipes
○ Reusable code libraries
● Bindings
Java, C, Perl, Python, REST, Ruby?
● Links:
http://zookeeper.apache.org
https://github.com/phunt