如何解决Kafka中奇怪的错误

如何解决Kafka中奇怪的错误

我尝试使用 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";
};

有人能指点一下如何解决这个问题吗?我试着用谷歌搜索,但没有任何结果。谢谢

相关内容