You are viewing documentation for an older version (0.10.2) of Kafka. For up-to-date documentation, see the latest version.
To enable ZooKeeper authentication on brokers, there are two necessary steps:
zookeeper.set.acl
in each broker to trueThe metadata stored in ZooKeeper for the Kafka cluster is world-readable, but can only be modified by the brokers. The rationale behind this decision is that the data stored in ZooKeeper is not sensitive, but inappropriate manipulation of that data can cause cluster disruption. We also recommend limiting the access to ZooKeeper via network segmentation (only brokers and some admin tools need access to ZooKeeper if the new Java consumer and producer clients are used).
If you are running a version of Kafka that does not support security or simply with security disabled, and you want to make the cluster secure, then you need to execute the following steps to enable ZooKeeper authentication with minimal disruption to your operations:
zookeeper.set.acl
to true, which enables the use of secure ACLs when creating znodes./bin/zookeeper-security-migration.sh
with zookeeper.acl
set to secure. This tool traverses the corresponding sub-trees changing the ACLs of the znodesIt is also possible to turn off authentication in a secure cluster. To do it, follow these steps:
zookeeper.set.acl
to false. At the end of the rolling restart, brokers stop creating znodes with secure ACLs, but are still able to authenticate and manipulate all znodes./bin/zookeeper-security-migration.sh
with zookeeper.acl
set to unsecure. This tool traverses the corresponding sub-trees changing the ACLs of the znodesHere is an example of how to run the migration tool:
./bin/zookeeper-security-migration --zookeeper.acl=secure --zookeeper.connect=localhost:2181
Run this to see the full list of parameters:
./bin/zookeeper-security-migration --help
It is also necessary to enable authentication on the ZooKeeper ensemble. To do it, we need to perform a rolling restart of the server and set a few properties. Please refer to the ZooKeeper documentation for more detail:
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.