Public | Automated Build

Last pushed: 9 months ago
Short Description
Docker image to set up a ZooKeeper cluster.
Full Description

docker-zookeeper

This project contains the files to set up a ZooKeeper cluster with Docker.

Image on Docker Hub: https://hub.docker.com/r/pviotti/zookeeper/

Running

Build Docker image

$ git clone https://github.com/pviotti/docker-zookeeper.git
$ cd docker-zookeeper
$ make build

Launch cluster

Environmental variables:

  • ZK_CLUSTER_SIZE – The number of nodes in your ZooKeeper cluster
    (default: 3)
$ make start
./start-cluster.sh

Bringing up cluster nodes:

Started zookeeper1 (172.18.0.2)
Started zookeeper2 (172.18.0.3)
Started zookeeper3 (172.18.0.4)

Test

$ make test
./test-cluster.sh
172.18.0.2:2181 Mode: follower
172.18.0.3:2181 Mode: leader
172.18.0.4:2181 Mode: follower

Stop and destroy

$ make stop
./stop-cluster.sh
Stopped the cluster and cleared all of the running containers.

Credits and license

License: Apache 2.0.

For this project I took some pieces of scripts and settings from

Docker Pull Command
Owner
pviotti
Source Repository

Comments (0)