kafka:动态更新jaas-config

o3imoua4  于 2021-06-04  发布在  Kafka
关注(0)|答案(1)|浏览(473)

我已经使用 sasl.jaas.config 财产。我想更新这个配置并动态添加用户。
根据本文件-http://kafka.apache.org/11/documentation.html#dynamicbrokerconfigs,我们可以使用 bin/kafka-configs.sh .
上面的文档有config列,如下所示-

我试过更新 sasl.jaas.config 使用以下命令: bin/kafka-configs.sh --bootstrap-server localhost:9092 --entity-type brokers --entity-name 59 --alter --add-config sasl.jaas.config="KafkaServer {\n org.apache.kafka.common.security.plain.PlainLoginModule required\n username=\"myuser\"\n password=\"mypassword\";\n};\nClient {\n org.apache.zookeeper.server.auth.DigestLoginModule required\n username=\"myuser2\"\n password=\"mypassword2\";\n};" 但它给了我以下错误: requirement failed: Invalid entity config: all configs to be added must be in the format "key=val" 如果我看上面的一列,它表示 sasl.jaas.config 财产是 (=)* . 这意味着什么?
“sasl.jaas.config”的值应该如何传递以动态更新jaas config?

nzrxty8p

nzrxty8p1#

虽然可以动态更新 sasl.jaas.config 为了添加更多用户,默认的普通登录模块不打算在生产中使用。
相反,您应该定义回调处理程序来处理用户的身份验证。这在Kafka萨斯尔平原文件中有描述。
另一个需要更多工作(但更具灵活性)的选项是创建自己的登录模块。kafka能否提供自定义loginmodule以支持ldap?中描述了该过程?
关于您收到的错误消息,这似乎是 kafka-config.sh 工具。它不希望配置值包含 = . 您应该能够使用adminclientapi更新配置。
我在jira中找不到现有问题,因此创建了一个新问题:https://issues.apache.org/jira/browse/kafka-8010

相关问题