Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Apache ZooKeeper Intro and Sample

DZone's Guide to

Apache ZooKeeper Intro and Sample

· Big Data Zone ·
Free Resource

Hortonworks Sandbox for HDP and HDF is your chance to get started on learning, developing, testing and trying out new features. Each download comes preconfigured with interactive tutorials, sample data and developments from the Apache community.

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 Community Connection (HCC) is an online collaboration destination for developers, DevOps, customers and partners to get answers to questions, collaborate on technical articles and share code examples from GitHub.  Join the discussion.

Topics:

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}