Hortonworks ZooKeeper is a centralized, reliable, service for maintaining
configuration information, naming, providing distributed
synchronization, and group services. All of these kinds of services
are used in some form or another by distributed applications.
In order to install and configure Hortonworks HBase and other Hadoop ecosystem
components, you must start the ZooKeeper service.

Hortonworks zookeeper for HDP 2.1

ZooKeeper is a centralized service for maintaining configuration information, naming, providing
distributed synchronization, and providing group services. All of these kinds of services are used
in some form or another by distributed applications. Each time they are implemented there is a lot
of work that goes into fixing the bugs and race conditions that are inevitable.

Because of the difficulty of implementing these kinds of services, applications initially usually
skimp on them ,which make them brittle in the presence of change and difficult to manage. Even when
done correctly, different implementations of these services lead to management complexity when the
applications are deployed.

To learn more about ZooKeeper visit the upstream docs

Deployment Strategy

Instruction to create a zookeeper node :

juju deploy hdp-zookeeper hdp-zookeeper

Step by step instructions to create a zookeeper quorum :

juju deploy hdp-zookeeper hdp-zookeeper
juju add-unit -n 2 hdp-zookeeper

How to integrate zookeeper into a your solution

add a relation file
1) Add relation metadata.yaml
requires:
zookeeper:
interface: zookeeper

2) Add zookeeper-relation-changed hook, example:
def zookeeper_relation_changed():
log('zookeeper-relation-changed called')
ZK_hostname = relation_get('private-address')
if not ZK_hostname:
sys.exit(0)

Caveats

The config option for zookeeper_data_dir is only set'able at deployment time. If you update this value post deployment it no-op's, as it would be destructive.

Charmer Contact Information

amir sanjar amir.sanjar@canonical.com

zookeeper Upstream Project Name

Configuration

zookeeper_data_dir
(string)
                            Directory where ZooKeeper will store data.
                        
/grid/hadoop/zookeeper/data
zk-port
(int)
                            ZooKeeper Client Access Port
                        
2181