Kafka对Zookeeper DIGEST-MD5身份验证错误

时间:2018-11-05 14:52:47

标签: security apache-kafka apache-zookeeper hortonworks-data-platform sasl

我可以使用Kafka提供的kafka代理和嵌入式zookeeper进行DIGEST-MD5身份验证,但是在使用Kafka代理和非嵌入式zookeeper(单独的zookeeper实例)进行DIGEST-MD5身份验证时,我得到了以下错误消息。 / p>

请在下面找到错误消息:

[2018-11-05 19:44:21,536] ERROR SASL authentication failed using login context 'Client' with exception: {} (org.apache.zookeeper.client.ZooKeeperSaslClient)

javax.security.sasl.SaslException: Error in authenticating with a Zookeeper Quorum member: the quorum member's saslToken is null.

org.apache.zookeeper.KeeperException$AuthFailedException: KeeperErrorCode = AuthFailed for /consumers

1 个答案:

答案 0 :(得分:2)

您的jaas文件是什么样的?

对于Zookeeper集群,Zookeeper jaas文件中必须包含三个部分: 服务器 QuorumServer QuorumLearner

QuorumServer QuorumLearner 部分用于对Zookeeper服务器进行身份验证。请参见基于§ DIGEST-MD5的身份验证

中的配置here的示例

服务器部分用于验证kafka代理。它应包含kafka用户名和密码,其格式设置为§服务器配置/ JAAS配置文件中的here:DIGEST-MD5身份验证

您的Kafka jaas文件应具有 Client 部分,其中包含用户名和密码,如§ Client Configuration / JAAS配置文件:DIGEST-MD5认证中的here所示

最后,检查是否为Zookeeper jaas文件使用了正确的环境变量:

SERVER_JVMFLAGS="-Djava.security.auth.login.config=/path/to/server/jaas/file.conf"

嵌入式动物园管理员使用KAFKA_OPTS