Configuring ZooKeeper

Last Updated : Oct 29, 2025 |

Procedure

  1. Open $KAFKA_HOME/config/zookeeper.properties file and change daraDir to $KAFKA_HOME/kafka-store/zookeeper.

    You can find the property details in the ZooKeeper administrator's guide on Apache ZooKeeper web site.

  2. Create zookeeper directory, under $KAFKA_HOME/kafka-store.
  3. Create myid file in $KAFKA_HOME/kafka-store/zookeeper directory.

    The myid file must contain unique zookeeper id and it must match with x in server.x mentioned for external Kafka entry in $KAFKA_HOME/config/zookeeper.properties.

    Example: If server.3 is mentioned, 3 becomes the zookeeper ID for myid file.

  4. The following are the Kakfa server configuration properties, highlighted in bold text, that gets updated after above configurations:
    dataDir=<KAFKA_HOME>/kafka-store/zookeeper
    secureClientPort=2182
    tickTime=2000
    initLimit=5
    syncLimit=2
    server.1=<IP_Primary_POM>:2888:3888
    server.2=<IP_AUX_POM>:2888:3888
    server.3=<IP_EXTERNAL_KAFKA>:2888:3888
  5. Start ZooKeeper using the command $KAFKA_HOME/bin/zookeeper-server-start.sh $KAFKA_HOME/config/zookeeper.properties.