ZooKeeper primer and use cases
found.no
found.no
etcd and others are quickly coming onto the scene, but zookeeper is still the right choice if you want full featured, robust software with a good ecosystem of tools & knowledge like Curator, Exhibitor, Cloud Formation, etc...
My plan was to increase the tick time quite a bit and use it for global (in the literal sense) service discovery and coordination.
At a high level, ZooKeeper gives you a low-level distributed primitives. While these are all you need to build leader election, service discovery, monitoring, etc, it does require you to actually build that all yourself.
Consul goes the route of providing high-level features instead of low-level primitives (although they are all there, and usable via an HTTP API). It makes it easy as an operations person to deploy, and just as easy as an app developer to integrate and use.
1. Only use with Java (JVM). The C client library which most other languages wrap to work with zookeeper is very buggy. It had lots of corner cases which would crash the application using it.
2. If you are on AWS make sure your zookeeper instances have static IPs (use EIPs or EINs). We had a cluster in AWS classic with the cluster defined by domain names. At startup zookeeper would lookup the IP for the domain and cache it, never checking it again. This meant you could only loose 1 node in a 5 node cluster as you needed the other spare to handle the missing node during a rolling restart. It was a PITA.
Personally I recommend etcd now if you need functionality of this sort, particularly if you are not using Java.
https://github.com/coreos/etcd/blob/master/Documentation/mod...