# Zookeeper configuration parameters

Published 2022-12-03

This tutorial explains to you the Zookeeper main configuration parameters.

# Where are located Zookeeper configuration parameters ?

Zookeeper configuration parameters are located in $ZOOKEEPER_HOME/config/zookeeper.properties

# Zookeeper configuration parameters

On my examples I created so far I used for Zookeeper server the following parameters:

  • dataDir - the directory where the Zookeeper data is stored.

  • clientPort - the port at which the clients will connect

  • maxClientCnxns - Limits the number of concurrent connections (at the socket level) that a single client, identified by IP address, may make to a single member of the ZooKeeper cluster. This is used to prevent certain classes of DoS attacks. Setting this to 0 or omitting it entirely removes the limit on concurrent connections.

  • admin.enableServer - Set to "false" to disable the AdminServer.

  • admin.serverPort - The port the embedded Jetty server listens on. Defaults to 8080.

  • tickTime - milleseconds every tick has

  • initLimit - Number of ticks (the time) the ZooKeeper servers in quorum have to connect to a leader

  • syncLimit - limits how far out of date a server can be from a leader

  • Declare Zookeeper servers

server.1=zookeeper1:2888:3888 server.2=zookeeper2:2888:3888 server.3=zookeeper3:2888:3888

  • 4lw.commands.whitelist - allows to use the Four Letter Words commands.

# Other Zookeeper configuration parameters

  • dataLogDir - directs the machine to write the transaction log to the dataLogDir rather than the dataDir. This allows a dedicated log device to be used, and helps avoid competition between logging and snaphots.

  • globalOutstandingLimit - prevents ZooKeeper from running out of memory due to queued requests, ZooKeeper will throttle clients so that there is no more than globalOutstandingLimit outstanding requests in the system. The default limit is 1,000.

  • leaderServes (in clusters) - For higher update throughput at the slight expense of read throughput, the leader can be configured to not accept clients and focus on coordination. The default to this option is yes, which means that a leader will accept client connections.