![如何解决Kafka中奇怪的错误](https://linux22.com/image/791697/%E5%A6%82%E4%BD%95%E8%A7%A3%E5%86%B3Kafka%E4%B8%AD%E5%A5%87%E6%80%AA%E7%9A%84%E9%94%99%E8%AF%AF.png)
我尝试使用 SASL_SSL 运行 Kafka。当我运行 Kafka 服务器时,它在服务器日志中记录了奇怪的错误:
[2023-12-19 01:57:09,297] INFO [Controller id=0, targetBrokerId=0] Client requested connection close from node 0 (org.apache.kafka.clients.NetworkClient)
[2023-12-19 01:57:09,452] INFO [SocketServer listenerType=ZK_BROKER, nodeId=0] Failed authentication with /127.0.0.1 (channelId=127.0.0.1:9092-127.0.0.1:61116-5) (Authentication failed during authentication due to invalid credentials with SASL mechanism SCRAM-SHA-256)
我的服务器.属性:
sasl.enabled.mechanisms=SCRAM-SHA-256
listeners=SASL_SSL://localhost:9092
advertised.listeners=SASL_SSL://localhost:9092
sasl.mechanism.inter.broker.protocol=SCRAM-SHA-256
security.inter.broker.protocol=SASL_SSL
ssl.keystore.location=C:/apps/certs/keystore.jks
ssl.keystore.password=sepultura1
ssl.key.password=sepultura1
ssl.truststore.location=C:/apps/certs/truststore.jks
ssl.truststore.password=sepultura1
ssl.client.auth=required
ssl.endpoint.identification.algorithm=
我的server.jaas.config:
KafkaServer {
org.apache.kafka.common.security.scram.ScramLoginModule required
username="user"
password="sepultura1";
};
Client {
org.apache.zookeeper.server.auth.DigestLoginModule required
username="user"
password="sepultura1";
};
我的zookeper.properties:
requireClientAuthScheme=sasl
authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider
initLimit=5
syncLimit=2
tickTime=2000
我的 zookeper.jaas.conf:
Client{
org.apache.zookeeper.server.auth.DigestLoginModule required
username=“user”
password=“sepultura1”;
};
QuorumServer {
org.apache.zookeeper.server.auth.DigestLoginModule required
user_user="user";
};
QuorumLearner {
org.apache.zookeeper.server.auth.DigestLoginModule required
username="user"
password="sepultura1";
};
Server{
org.apache.zookeeper.server.auth.DigestLoginModule required
user_user="sepultura1";
};
有人能指点一下如何解决这个问题吗?我试着用谷歌搜索,但没有任何结果。谢谢