Bigdata Dev Apache Zookeeper

juju deploy bigdata-dev-apache-zookeeper
Show information
You will need Juju 2.9 to be able to run this command. Learn how to upgrade to Juju 2.9.
Channel Version Revision Published Runs on
latest/stable 24 24 18 Mar 2021
Ubuntu 14.04
latest/edge 18 18 18 Mar 2021
Ubuntu 14.04

Platform:

Ubuntu
14.04

About

High-performance coordination service for distributed applications Read more


Relevant links


Discuss this charm

Share your thoughts on this charm with the community on discourse.

Join the discussion

Overview

Apache ZooKeeper is a high-performance coordination service for distributed applications. It exposes common services such as naming, configuration management, synchronization, and group services in a simple interface so you don't have to write them from scratch. You can use it off-the-shelf to implement consensus, group management, leader election, and presence protocols.

Usage

Deploy a Zookeeper unit. With only one unit, the service will be running in standalone mode:

juju deploy apache-zookeeper zookeeper

Scaling

Running ZooKeeper in standalone mode is convenient for evaluation, some development, and testing. But in production, you should run ZooKeeper in replicated mode. A replicated group of servers in the same application is called a quorum, and in replicated mode, all servers in the quorum have copies of the same configuration file.

Scaling Zookeeper to create a quorum is trivial. The following will add two additional Zookeeper units and will automatically configure them with knowledge of the other quorum members based on their peer relation to one another:

juju add-unit -n 2 zookeeper

Test the deployment

Test if the Zookeeper service is running by using the zkServer.sh script:

juju run --service=zookeeper '/usr/lib/zookeeper/bin/zkServer.sh status'

A successful deployment will report the service mode as either standalone (if only one Zookeeper unit has been deployed) or leader / follower (if a Zookeeper quorum has been formed).

REST API

Zookeeper REST Api can be enabled/disabled either through an action or via a config variable:

juju action do zookeeper/0 start-rest
juju action do zookeeper/0 stop-rest

or

juju set zookeeper rest=true

Integrate Zookeeper into another charm

1) Add following lines to your charm's metadata.yaml:

requires:
  zookeeper:
     interface: zookeeper

2) Add a zookeeper-relation-changed hook to your charm. Example contents:

from charmhelpers.core.hookenv import relation_get
ZK_hostname = relation_get('private-address')
ZK_port = relation_get('port')

Contact Information

bigdata@lists.ubuntu.com

Help