Zookeeper: Example

This lesson works through an example distributed systems problem that can be solved using Zookeeper.

We'll cover the following

So what kind of problems can Zookeeper solve? Zookeeper’s higher-level constructs can solve several common distributed systems problems. A list of such recipes appears on the official project website. We’ll work with a simple problem to demonstrate the use of the Zookeeper API. We’ll write a program that has a spawned thread, create a znode, and update it with a new value after every second for a total of five times. A watch is set on the same znode in the main thread. Notifications are received whenever the znode value changes. The values are printed on the console. The code for the program appears below:

Get hands-on with 1200+ tech skills courses.