Zac*_*ach 2 java kerberos apache-kafka message-hub kafkacat
在尝试将 kafkacat 与消息中心一起使用时,我使用了以下内容:
kafkacat -X client.id=xxxxx \
-X sasl.jaas.config='org.apache.kafka.common.security.plain.PlainLoginModule required username="xxxx" password="xxxx";' \
-X security.protocol=SASL_SSL \
-X sasl.mechanism=PLAIN \
-X ssl.protocol=TLSv1.2 \
-X ssl.enabled.protocols=TLSv1.2 \
-X ssl.truststore.type=JKS \
-X ssl.endpoint.identification.algorithm=HTTPS -b broker:port -C -t topic
Run Code Online (Sandbox Code Playgroud)
并得到以下错误:
% ERROR: Java JAAS configuration is not supported, see https://github.com/edenhill/librdkafka/wiki/Using-SASL-with-librdkafka for more information.
Run Code Online (Sandbox Code Playgroud)
如何使用 kerberos 和提供的凭据来创建正确的密钥,然后使用它们从主题中使用?
您不能在 kafkacat 中使用 Java 参数名称。
您需要改用librdkafka 配置名称。例如,以下将运行一个消费者:
kafkacat -X "security.protocol=sasl_ssl" -X 'sasl.mechanisms=PLAIN' \
-X 'sasl.username=token' -X "sasl.password=<APIKEY>" \
-X "ssl.ca.location=<CERTS_PATH>" -b <BOOTSTRAP_SERVERS> -C -t <TOPIC>
Run Code Online (Sandbox Code Playgroud)
示例中指定的配置适用于消息中心。
<CERTS_PATH>
取决于您的操作系统:
/etc/ssl/cert.pem
/Ubuntu/IBM Cloud: /etc/ssl/certs/
/etc/pki/tls/cert.pem
归档时间: |
|
查看次数: |
1449 次 |
最近记录: |