Skip to content

Latest commit

 

History

History

zookeeper

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Zookeeper

ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services.


Install Zookeeper Standalone Mode Using Docker Compose

  1. Before setting everything else, create a directory for Zookeeper home mount. Ensure that the directory exists and appropriate permission have been granted.

    $ mkdir -vp ~/docker/zookeeper
    $ chown -R 1001:root ~/docker/zookeeper
  2. Modify the .env file, you can fine tune these configurations to meet your requirements.

    # common
    ZOO_IMAGE=bitnami/zookeeper:3.8
    ZOO_HEAP_SIZE=256
    ZOO_4LW_COMMANDS_WHITELIST=srvr, mntr, conf, ruok
    ZOO_ALLOW_ANONYMOUS_LOGIN=yes        # Set to yes, the user Settings are invalid
    ZOO_ENABLE_AUTH=false                # Set to false, ZOO_ALLOW_ANONYMOUS_LOGIN must is yes
    ZOO_ENABLE_ADMIN_SERVER=true         # Whether to start the admin server, http://ip:8080/commands
    ZOO_SERVER_USERS=user1,user2,admin
    ZOO_SERVER_PASSWORDS=pass4user1,pass4user2,pass4admin
    ZOO_CLIENT_USER=user1
    ZOO_CLIENT_PASSWORD=pass4user1
    
    # zookeeper standalone mode
    ZOO_HOME=~/docker/zookeeper
    ZOO_PORT_2181=2181
    ZOO_PORT_8080=8080
  3. Make sure you are in the same directory as zookeeper.yml and start Zookeeper:

    $ docker-compose -f zookeeper.yml up -d
  4. If something else goes wrong, for more detailed tutorial can be found on the Bitnami Zookeeper

Install Zookeeper Cluster Mode Using Docker Compose

  1. Before setting everything else, create a directory for Zookeeper home mount. Ensure that the directory exists and appropriate permission have been granted.

    $ mkdir -vp ~/docker/zookeeper-cluster/{node1,node2,node3}
    $ chown -R 1001:root ~/docker/zookeeper-cluster
  2. Modify the .env file, you can fine tune these configurations to meet your requirements.

    # common
    ZOO_IMAGE=bitnami/zookeeper:3.8
    ZOO_HEAP_SIZE=256
    ZOO_4LW_COMMANDS_WHITELIST=srvr, mntr, conf, ruok
    ZOO_ALLOW_ANONYMOUS_LOGIN=yes        # Set to yes, the user Settings are invalid
    ZOO_ENABLE_AUTH=false                # Set to false, ZOO_ALLOW_ANONYMOUS_LOGIN must is yes
    ZOO_ENABLE_ADMIN_SERVER=true         # Whether to start the admin server, http://ip:8080/commands
    ZOO_SERVER_USERS=user1,user2,admin
    ZOO_SERVER_PASSWORDS=pass4user1,pass4user2,pass4admin
    ZOO_CLIENT_USER=user1
    ZOO_CLIENT_PASSWORD=pass4user1
    
    # zookeeper cluster mode
    ZOO_CLUSTER_HOME=~/docker/zookeeper-cluster
    ZOO_CLUSTER_NODE1_2181=12181
    ZOO_CLUSTER_NODE1_8080=18080
    ZOO_CLUSTER_NODE2_2181=22181
    ZOO_CLUSTER_NODE2_8080=28080
    ZOO_CLUSTER_NODE3_2181=32181
    ZOO_CLUSTER_NODE3_8080=38080
  3. Make sure you are in the same directory as zookeeper-cluster.yml and start Zookeeper:

    $ docker-compose -f zookeeper-cluster.yml up -d
  4. If something else goes wrong, for more detailed tutorial can be found on the Bitnami Zookeeper