Docker image to set up a ZooKeeper cluster.
Image on Docker Hub: https://hub.docker.com/r/pviotti/zookeeper/
Build Docker image
$ git clone https://github.com/pviotti/docker-zookeeper.git $ cd docker-zookeeper $ make build
ZK_CLUSTER_SIZE– The number of nodes in your ZooKeeper cluster
$ 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)
$ 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