如何在kafka本地启用SASL机制
How to enable SASL mechanism with JAAS Authentication for kafka ? thus the consumer/producer have to provide username & password in order to be able to publish in the broker
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 Kafka 中启用 SASL 身份验证的过程在使用 SASL 进行身份验证部分中有详细描述。文档。我建议您遵循官方文档,因为它包含所有机制的说明和生产环境的建议。
为了提供一些背景知识,您需要:
使用
KafkaServer
块和特定机制的配置为代理创建 JAAS 文件。将
-Djava.security.auth.login.config=
添加到代理 JVM 命令行参数。通过
security.protocol
、sasl.mechanism
和sasl.jaas.config
设置将客户端配置为使用 SASL。The process of enabling SASL authentication in Kafka is extensively described in the Authentication using SASL section in the documentation. I suggest you follow the official documentation as it contains instructions for all the mechanisms and recommendations for production environments.
To give a bit of background, at a glance you need to:
Create a JAAS file for brokers with a
KafkaServer
block and the configuration for the specific mechanism.Add
-Djava.security.auth.login.config=<PATH_TO_JAAS_FILE>
to your broker JVM command line argument.Configure client to use SASL via the
security.protocol
,sasl.mechanism
andsasl.jaas.config
settings.