Announcing: The Pulsar PMC Published The 2020 Apache Pulsar User Survey Report!

Overview
Get started
Install and upgrade
Configure
Overview
Pulsar core
ZooKeeper
BookKeeper
Broker
KoP
Tiered storage
Pulsar Functions
WebSocket
Proxy
Control center
Tool
Secure
Manage and monitor
Connect
Process
Release notes

Configure Zookeeper

ZooKeeper is used by Pulsar and BookKeeper in StreamNative Platform and it handles a broad range of essential configuration-related and coordination-related tasks for Pulsar.

After installing StreamNative Platform, if you want to change the configuration, edit the ${PLATFORM_HOME}/etc/pulsar/zookeeper.conf file.

ZooKeeper configurations are listed as below:

Name Description Default
tickTime The tick is the basic unit of time in ZooKeeper, measured in milliseconds and used to regulate things like heartbeats and timeouts. tickTime is the length of a single tick. 2000
initLimit The maximum time, in ticks, that the leader ZooKeeper server allows follower ZooKeeper servers to successfully connect and sync. The tick time is set in milliseconds using the tickTime parameter. 10
syncLimit The maximum time, in ticks, that a follower ZooKeeper server is allowed to sync with other ZooKeeper servers. The tick time is set in milliseconds using the tickTime parameter. 5
dataDir The location where ZooKeeper will store in-memory database snapshots as well as the transaction log of updates to the database. data/zookeeper
clientPort The port on which the ZooKeeper server will listen for connections. 2181
autopurge.snapRetainCount In ZooKeeper, auto purge determines how many recent snapshots of the database stored in dataDir to retain within the time interval specified by autopurge.purgeInterval (while deleting the rest). 3
autopurge.purgeInterval The time interval, in hours, by which the ZooKeeper database purge task is triggered. Setting to a non-zero number will enable auto purge; setting to 0 will disable. Read this guide before enabling auto purge. 1
maxClientCnxns The maximum number of client connections. Increase this if you need to handle more ZooKeeper clients. 60

In addition to the parameters in the table above, configuring ZooKeeper for Pulsar involves adding a server.N line to the ${PLATFORM_HOME}/etc/pulsar/zookeeper.conf file for each node in the ZooKeeper cluster, where N is the number of the ZooKeeper node. Here's an example for a three-node ZooKeeper cluster:

server.1=zk1.us-west.example.com:2888:3888
server.2=zk2.us-west.example.com:2888:3888
server.3=zk3.us-west.example.com:2888:3888

For more information about ZooKeeper configuration, see ZooKeeper administrator's guide.