Over a million developers have joined DZone.

Apache ZooKeeper Intro and Sample

· Big Data Zone

Learn how you can maximize big data in the cloud with Apache Hadoop. Download this eBook now. Brought to you in partnership with Hortonworks.

ZooKeeper is an open source distributed configuration service, synchronization service, and naming registry for large distributed systems. ZooKeeper was a sub project of Hadoop. ZooKeeper's architecture supports high-availability through redundant services. It support naming service, configuration management, synchronization, leader election, message Queue and notification system. ZooKeeper is a high-performance coordination service for distributed applications

“ZooKeeper: Because Coordinating Distributed Systems is a Zoo”

Let is start work with Zoo-Keeper.

1. Download stable version from here

2. Unzip it ‘C:\zookeeper\zookeeper-3.4.6\’

3. Setup zoo configuration in <zookeeper-home>\zoo.cfg

  • tickTime: do heartbeats and the minimum session timeout (milliseconds)
  • dataDir: the location to store
  • clientPort: the port to listen for client connections

eg:

tickTime=2000
initLimit=10
syncLimit=5
dataDir=C:\zookeeper\zookeeper-3.4.6\data
clientPort=2181

4. You can define log level and log properties in ‘log4j.properties’

5. You can start zookeeper server by  zkServer.cmd/ .sh

image

6. Sample client can be start by  zkCli.cmd / .sh

image

References

[1] http://zookeeper.apache.org/releases.html

Hortonworks DataFlow is an integrated platform that makes data ingestion fast, easy, and secure. Download the white paper now.  Brought to you in partnership with Hortonworks

Topics:

Published at DZone with permission of Madhuka Udantha, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}