Sign inSign up

mbe1224/zookeeper

By mbe1224

Updated almost 8 years ago

Docker ZooKeeper image using Oracle JDK

Image
1

1.5K

mbe1224/zookeeper repository overview

Docker ZooKeeper image using Oracle JDK

Summary:
  • Debian Stretch "slim" image variant
  • Oracle JDK 8u152 addded, without MissionControl, VisualVM, JavaFX, ReadMe files, source archives, etc.
  • Oracle Java Cryptography Extension added
  • Python 2.7.13-2 & pip 9.0.1 added
  • Verified downloads
  • JAVA_HOME environment variable set up
  • Utility scripts added for generating the configuration files
Usage:

Build the image

docker build -t mbe1224/zookeeper ./3.4.11/

Run the container

docker run -d --name=zookeeper mbe1224/zookeeper
Configuration:

One can configure a ZooKeeper instance using environment variables. All configuration options from the official documentation can be used as long as the following naming rules are followed:

  • upper caps
  • "." replaced with "_"
  • snake case instead of pascal case
  • "ZOOKEEPER_" prefix

For example, in order to limit the number of concurrent connections a single client may make to a single member of the ZooKeeper ensemble, one has to modifiy the "maxClientCnxns" property, which is translated in the "ZOOKEEPER_MAX_CLIENT_CNXNS" environment variable.

The following default values are used:

#NameDefault valueMeaning
1ZOOKEEPER_CLIENT_PORT2181The port to listen for client connections
2ZOOKEEPER_DATA_DIR/var/lib/zookeeper/dataThe location where ZooKeeper will store the in-memory database snapshots and, unless specified otherwise, the transaction log of updates to the database
3ZOOKEEPER_DATA_LOG_DIR/var/lib/zookeeper/logThis allows a dedicated log device to be used, and helps avoid competition between logging and snaphots
4ZOOKEEPER_INIT_LIMIT10Timeouts ZooKeeper uses to limit the length of time the ZooKeeper servers in quorum have to connect to a leader
5ZOOKEEPER_LOG4J_ROOT_LOGLEVELINFO-
6ZOOKEEPER_SYNC_LIMIT5Timeouts ZooKeeper to limit how far out of date a server can be from a leader

In addition to these, the following environment variables are added for replicated scenarios:

#NameMeaning
1ZOOKEEPER_GROUPSSemicolon separated list of indexed group identifiers used for forming hierarchical quorums
2ZOOKEEPER_SERVER_IDNode identifier
3ZOOKEEPER_SERVERSSemicolon separated list of host:port1:port2 where port1 is used for follower connections, if the current node is the leader and port2 is used for server connections during the leader election phase
4ZOOKEEPER_WEIGHTSSemicolon separated list of indexed weights used for forming quorums

Furthrmore, one can tweak the JVM heap size using the JVM_HEAP_SIZE environment variable, that has a default value of 2GB.

For more information, check the Apache ZooKeeper's Official Documentation.

Kubernetes:

For Kubernetes deployments using StatefulSets (or other replication objects), ZOOKEEPER_SERVER_ID can't be set up in advance. Therefore, one needs to set the IS_KUBERNETES environemnt variable to a non-null value. In this scenario, ZooKeeper's ID (myid) will be generated using the value of the HOSTNAME environment variable.

Nevertheless, if one uses Pods, than the usual setup can be used and the IS_KUBERNETES environemnt variable must be ignored.

Dual licensed under:

Tag summary

Content type

Image

Digest

Size

115.6 MB

Last updated

over 8 years ago

docker pull mbe1224/zookeeper