The Origin of The Name "Zookeeper"
The Origin of The Name "Zookeeper"
across a cluster.
So, in case of Hadoop, ZooKeeper will help you with coordination between Hadoop nodes.
ZooKeeper, in fact, borrows a number of concepts from these prior systems. It does not
expose a lock interface or a general purpose interface for storing data, however. The design
of ZooKeeper is specialized and very focused on coordination tasks. It is certainly possible
to build distributed systems without using ZooKeeper. ZooKeeper, however, offers
developers the possibility of focusing more on application logic rather than on arcane
distributed systems concepts. Programming distributed systems without ZooKeeper is
possible, but more difficult.
The problems described above are functional problems that you can design solutions for
and you can test your solutions before deployment. But the truly difficult problems
encounter, when the distributed applications have to do with faults specifically, crashes and
communication faults. These failures can crop up at any point, and it may be impossible to
enumerate all the different cases that need to be handled.
One of the diferences between single machine and distributed applications is: When a
single machine crashes, all the processes running on that machine fail. If there are multiple
processes running on the machine and a process fails, the other processes can find out
about the failure from the operating system. The operating system can also provide strong
messaging guarantees between processes. All of this changes in a distributed environment:
if a machine or process fails, other machines will keep running and may need to take over
for the faulty processes. To handle faulty processes, the processes that are still running
must be able to detect the failure; messages may be lost, and there may even be clock drift.
Having pointed out that the perfect solution is impossible, we can repeat that ZooKeeper is
not going to solve all the problems that the distributed application developer has to face. It
does give the developer a nice framework to deal with these problems, though.
ZooKeeper exposes a simple interface for Naming service which identifies the nodes
in a cluster by name simialr to DNS.
ZooKeeper provides for an easy way for you to implement distributed mutexes to
allow for serialized access to a shared resource in your distributed system.
You can use ZooKeeper to centrally store and manage the configuration of your
distributed system. This means that any new nodes joining will pick up the up-to-date
centralized configuration from ZooKeeper as soon as they join the system. This also
allows you to centrally change the state of your distributed system by changing the
centralized configuration through one of the ZooKeeper clients.
ZooKeeper provides off-the-shelf support for leader election which will deal with the
problem of nodes going down.