jonny@Debian:/opt/kafka_2.11-0.11.0.0/config$ cat zookeeper.properties
dataDir=/var/tmp/zookeeper
clientPort=2181
maxClientCnxns=0
authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider
requireClientAuthScheme=sasl
jaasLoginRenew=3600000
#----
jonny@Debian:/opt/kafka_2.11-0.11.0.0/config$ cat server.properties
security.inter.broker.protocol=SASL_PLAINTEXT
sasl.mechanism.inter.broker.protocol=PLAIN
sasl.enabled.mechanisms=PLAIN
authorizer.class.name=kafka.security.auth.SimpleAclAuthorizer
allow.everyone.if.no.acl.found=true
auto.create.topics.enable=true
broker.id=0
listeners=SASL_PLAINTEXT://0.0.0.0:9092
advertised.listeners=SASL_PLAINTEXT://[PUBLIC IP]:9092
num.network.threads=3
num.io.threads=8
socket.send.buffer.bytes=102400
socket.receive.buffer.bytes=102400
socket.request.max.bytes=104857600
advertised.host.name=
dataDir=/var/tmp/zookeeper
clientPort=2181
maxClientCnxns=0
authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider
requireClientAuthScheme=sasl
jaasLoginRenew=3600000
#----
jonny@Debian:/opt/kafka_2.11-0.11.0.0/config$ cat server.properties
security.inter.broker.protocol=SASL_PLAINTEXT
sasl.mechanism.inter.broker.protocol=PLAIN
sasl.enabled.mechanisms=PLAIN
authorizer.class.name=kafka.security.auth.SimpleAclAuthorizer
allow.everyone.if.no.acl.found=true
auto.create.topics.enable=true
broker.id=0
listeners=SASL_PLAINTEXT://0.0.0.0:9092
advertised.listeners=SASL_PLAINTEXT://[PUBLIC IP]:9092
num.network.threads=3
num.io.threads=8
socket.send.buffer.bytes=102400
socket.receive.buffer.bytes=102400
socket.request.max.bytes=104857600
advertised.host.name=

本文档详细介绍了如何配置Kafka SASL/PLAINTEXT身份验证,包括Zookeeper、Kafka服务器、消费者和生产者的配置,以及使用kafka-acls.sh进行权限管理。同时,还提供了Python客户端的连接示例,确保了从客户端到服务端的完整安全设置。
最低0.47元/天 解锁文章
1795

被折叠的 条评论
为什么被折叠?



