Kafka配置kerberos(CDH)
参考文档:https://www.jianshu.com/p/dd73b318e743vi jaas.confKafkaClient{com.sun.security.auth.module.Krb5LoginModule requireduseTicketCache=true;renewTicket=true;};vi client...
参考文档:https://www.jianshu.com/p/dd73b318e743
vi jaas.conf
KafkaClient{
com.sun.security.auth.module.Krb5LoginModule required
useTicketCache=true;
renewTicket=true;
};
vi client.properties
security.protocol=SASL_PLAINTEXT
sasl.kerberos.service.name=kafka
kinit test20
export KAFKA_OPTS="-Djava.security.auth.login.config=/opt/cloudera/parcels/CDH/lib/kafka/bin/jaas.conf"
启动producer前必须设置,否则报错
Caused by: java.lang.IllegalArgumentException: Could not find a 'KafkaClient' entry in the JAAS configuration.
System property 'java.security.auth.login.config' is not set
没有配置keytab,会出现如下错误 javax.security.auth.login.LoginException: Could not login: the client is being asked for a password,
but the Kafka client code does not currently support obtaining a password
kinit可以解决此问题: kinit -kt /home/test20/test20.keytab test20/cdh@HADOOP.COM
kafka-console-producer --broker-list 192.168.142.12:9092,192.168.142.11:9092,192.168.142.13:9092 --topic test --producer.config client.properties
export KAFKA_OPTS="-Djava.security.auth.login.config=/opt/cloudera/parcels/CDH/lib/kafka/bin/jaas.conf"
启动producer前必须设置,否则报错
Caused by: java.lang.IllegalArgumentException: Could not find a 'KafkaClient' entry in the JAAS configuration.
System property 'java.security.auth.login.config' is not set
没有配置keytab,会出现如下错误 javax.security.auth.login.LoginException: Could not login: the client is being asked for a password,
but the Kafka client code does not currently support obtaining a password
kinit可以解决此问题: kinit -kt /home/test20/test20.keytab test20/cdh@HADOOP.COM
kafka-console-consumer --topic test --bootstrap-server 192.168.142.12:9092,192.168.142.11:9092,192.168.142.13:9092 --consumer.config client.properties
更多推荐
所有评论(0)