Book Image

Apache ZooKeeper Essentials

By : Haloi
Book Image

Apache ZooKeeper Essentials

By: Haloi

Overview of this book

Whether you are a novice to ZooKeeper or already have some experience, you will be able to master the concepts of ZooKeeper and its usage with ease. This book assumes you to have some prior knowledge of distributed systems and high-level programming knowledge of C, Java, or Python, but no experience with Apache ZooKeeper is required.
Table of Contents (9 chapters)
4
4. Performing Common Distributed System Tasks
8
Index

Python client bindings

Apache ZooKeeper is shipped with an official client binding for Python, which is developed on top of the C bindings. It can be found in the contrib/zkpython directory of the ZooKeeper distribution. To build and install the Python binding, refer to the instructions in the README file there. In this section, we will learn about another popular Python client library for ZooKeeper, called Kazoo (https://kazoo.readthedocs.org/).

Kazoo is a pure Python library for ZooKeeper, which means that, unlike the official Python bindings, Kazoo is implemented fully in Python and has no dependency on the C bindings of ZooKeeper. Along with providing both synchronous and asynchronous APIs, the Kazoo library also provides APIs for some distributed data structure primitives such as distributed locks, leader election, distributed queues, and so on.

Installation of Kazoo is very simple, which can be done either with pip or easy_install installers:

Using pip, Kazoo can be installed with the...