go - 用于 kerberos 身份验证的 librd Kafka 配置设置
问题描述
我的目标集群启用了 kerberos。从控制台,生产者连接正在工作。
./kafka-console-producer.sh --broker-list targetHost:port --topic test --producer.config /path/to/client.properties
我在 bash_profile 中添加了以下条目以传递 jaas.conf 和 krb5.conf
export KAFKA_OPTS="-Djava.security.auth.login.config=/path/to/jaas.conf -Djava.security.krb5.conf=/path/to/krb5.conf"
这是 client.properties 设置。
security.protocol=SASL_PLAINTEXT
sasl.kerberos.service.name=kafka
我正在使用librdkafka
向 Kafka 生成消息security.protocol
并sasl.kerberos.service.name
为 kafkaconfigmap
对象进行配置。但是连接没有发生。
我如何集成jaas.conf
和krb5.conf
通过 GoLang。
错误:
[thrd:sasl_plaintext://targetHost:port/bootstrap]:sasl_plaintext://targetHost:port/bootstrap:初始化 SASL 身份验证失败:SASL 握手失败(开始(-1)):SASL(-1):一般失败: GSSAPI 错误:杂项故障(查看文本(服务器(kafka/targetHost)在查找“targetHost”时未知)(缓存结果,128 秒内超时)
解决方案
添加以下环境变量后,此问题已得到解决。
导出 KRB5_CONFIG="/path/to/krb5.conf
另外添加了以下 kafka 配置选项
sasl.kerberos.keytab: /path/to/keytab/file.keytab
推荐阅读
- android - How to customize android style in FirebaseUI
- c++ - How would I make a UTF-8 letter code when i have its binary equivalent? C++
- python - Djangon 2.2 filtering a single data set across pages
- php - How to validate complex JSON array in PHP Laravel
- powershell - Add-Content -PassThru is writing to file but not passing output to console
- amazon-web-services - 无法登录。Tableau SAML 中的用户名或密码无效
- bootstrap-4 - 如何为移动设备将 flex cloumns 包装在单行中
- actionscript-3 - Actionscript 表演滑稽
- c# - 根据方法参数值获取枚举值
- google-apps-script - g-suite Google Calender Apps 事件保存/更新脚本