Configuring ZooKeeper for Use with Kafka
Here are several recommendations for ZooKeeper configuration with Kafka:
-
Do not run ZooKeeper on a server where Kafka is running.
-
When using ZooKeeper with Kafka you should dedicate ZooKeeper to Kafka, and not use ZooKeeper for any other components.
-
Make sure you allocate sufficient JVM memory. A good starting point is 4GB.
-
To monitor the ZooKeeper instance, use JMX metrics.
Configuring ZooKeeper for Multiple Applications
If you plan to use the same ZooKeeper cluster for different applications (such as
Kafka cluster1, Kafka cluster2, and HBase), you should add a chroot
path so
that all Kafka data for a cluster appears under a specific path.
The following example shows a sample chroot
path:
c6401.ambari.apache.org:2181:/kafka-root,
c6402.ambari.apache.org:2181:/kafka-root
You must create this chroot
path yourself before starting the broker, and
consumers must use the same connection string.