问题描述
当我从 kakfa_2.12-2.3.0 中的包运行 zookeeper 时,出现以下错误
when i run the zookeeper from the package in the kakfa_2.12-2.3.0 i am getting the following error
$ export KAFKA_OPTS="-Djava.security.auth.login.config=/kafka/kafka_2.12-2.3.0/config/zookeeper_jaas.conf"
$ ./bin/zookeeper-server-start.sh config/zookeeper.properties
而 zookeeper_jaas.conf 是
KafkaServer {
org.apache.kafka.common.security.plain.PlainLoginModule required
username="admin"
password="admin-secret"
user_admin="admin-secret";
};
zookeeper.properties 文件是
server=localhost:9092
#server=localhost:2888:3888
sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="ibm" password="ibm-secret";
security.protocol=SASL_SSL
sasl.mechanism=PLAIN
ssl.truststore.location=**strong text**/kafka/apache-zookeeper-3.5.5-bin/zookeeperkeys/client.truststore.jks
ssl.truststore.password=test1234
authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider
jaasLoginRenew=3600000
requireClientAuthScheme=sasl
任何人都可以建议可能是什么原因
can anyone suggest what could be the reason
推荐答案
您似乎将一堆 Kafka SASL 配置混入您的 Zookeeper 配置文件中.Zookeeper 和 Kafka 都有不同的 SASL 支持,所以它不会工作.
You seem to have mixed up a bunch of Kafka SASL configuration into your Zookeeper configuration files. Both Zookeeper and Kafka have different SASL support so it's not going to work.
我猜您想在 Kafka 和 Zookeeper 之间启用 SASL 身份验证.在这种情况下,您需要遵循 Zookeeper Server-Client 指南:https://cwiki.apache.org/confluence/display/ZOOKEEPER/Client-Server+mutual+authentication
I'm guessing you want to enable SASL authentication between Kafka and Zookeeper. In that case you need to follow the Zookeeper Server-Client guide: https://cwiki.apache.org/confluence/display/ZOOKEEPER/Client-Server+mutual+authentication
Zookeeper 不支持 SASL Plain,但 DigestMD5 非常相似.在这种情况下,您的 jaas.conf
文件应如下所示:
Zookeeper does not support SASL Plain, but DigestMD5 is pretty similar. In that case your jaas.conf
file should look like:
Server {
org.apache.zookeeper.server.auth.DigestLoginModule required
user_super="adminsecret"
user_bob="bobsecret";
};
然后您需要配置您的 Kafka brokers 以使用 SASL 连接到 Zookeeper.您可以使用另一个 jaas.conf
文件(这次在 Kafka 中加载它):
Then you need to configure your Kafka brokers to connect to Zookeeper with SASL. You can do that using another jaas.conf
file (this time loading it in Kafka):
Client {
org.apache.zookeeper.server.auth.DigestLoginModule required
username="bob"
password="bobsecret";
};
注意:您还可以在 Zookeeper 服务器之间启用 SASL.为此,请遵循服务器-服务器指南:https://cwiki.apache.org/confluence/display/ZOOKEEPER/Server-Server+mutual+authentication
这篇关于在“/kafka/kafka_2.12-2.3.0/config/zookeeper_jaas.conf"中找不到名为“Server"的 JAAS 配置部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!