我是Confluent Kafka的新手,这是我到目前为止所做的,1
start kafka_2.12-2.1.0.\bin\windows\zookeeper-server-start.bat kafka_2.12-2.1.0.\config\zookeeper.properti
es制作批处理文件Apache Kafka
启动kafka_2.12-2.1.0 \ bin \ windows \ kafka-server-start.bat kafka_2.12-2.1.0 \ config \ server.properties
[开始使用批处理文件的生产者。
开始kafka_2.12-2.1.0。\ bin \ windows \ kafka-console-producer.bat --broker-list localhost:9092 --topic 3drocket-player
运行正常,但现在我正在寻找身份验证。因为我必须使用特定的身份验证设置来实现使用者(客户端要求)。就像安全协议是SASL SSL和SSL机制是GSSAPI。因此,我尝试搜索并找到confluet documentation,但问题是它太抽象了,以至于无法执行每个步骤。我正在根据自己的设置寻找详细的配置步骤。如何使用SASL SSL和GSSAPI协议配置我的kafka服务器。最初,我发现GSSAPI / Keberos具有单独的服务器,那么,我需要安装更多服务器吗?在Confluent kafka中,有任何内置解决方案。
在server.properties中配置SASL端口
例如)
listeners=SASL_SSL://host.name:port
security.inter.broker.protocol=SASL_SSL
sasl.mechanism.inter.broker.protocol=GSSAPI
sasl.enabled.mechanisms=GSSAPI
sasl.kerberos.service.name=kafka
ssl.keystore.location=/path/to/keystore.jks
ssl.keystore.password=keystore_password
ssl.truststore.location=/path/to/truststore.jks
ssl.truststore.password=truststore_password
ssl.enabled.protocols=TLSv1.2,TLSv1.1,TLSv1
https://kafka.apache.org/documentation/#security_configbrokerhttps://kafka.apache.org/documentation/#security_sasl_config
客户:运行Kafka客户端时,需要设置这些属性。
security.protocol=SASL_SSL
ssl.truststore.location=/path/to/truststore.jks
ssl.truststore.password=truststore_password
sasl.mechanism=GSSAPI
sasl.kerberos.service.name=kafka
https://kafka.apache.org/documentation/#security_configclientshttps://kafka.apache.org/documentation/#security_sasl_kerberos_clientconfig
然后配置JAAS配置
KafkaClient {
com.sun.security.auth.module.Krb5LoginModule required
useKeyTab=true
keyTab="path/to/kafka_client.keytab"
storeKey=true
useTicketCache=false
principal="[email protected]";
};