Created
February 15, 2019 11:29
-
-
Save marinakr/3ceab849944c39c6cc0052579c3c2229 to your computer and use it in GitHub Desktop.
How to start kafka broker with sasl_plaintext auth
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Support SASL_PLAIN auth for kafka broker | |
Kafka broker can be configure like | |
`/usr/local/etc/kafka/server.properties`: | |
``` | |
listeners=SASL_PLAINTEXT://localhost:9093 | |
advertised.listeners=SASL_PLAINTEXT://localhost:9093 | |
security.inter.broker.protocol=SASL_PLAINTEXT | |
sasl.mechanism.inter.broker.protocol=PLAIN | |
sasl.enabled.mechanisms=PLAIN | |
``` | |
JAAS file `kafka_server_jaas.conf`: | |
``` | |
KafkaServer { | |
org.apache.kafka.common.security.plain.PlainLoginModule required | |
username="admin" | |
password="admin-secret" | |
user_admin="admin-secret" | |
user_alice="alice-secret"; | |
}; | |
``` | |
Export Kafka Options before start kafka broker: | |
`export KAFKA_OPTS="-Djava.security.auth.login.config=/Users/workspace/kafka/kafka_server_jaas.conf` | |
Start kafka broker: | |
`kafka-server-start /usr/local/etc/kafka/server.properties` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment