如何将kafkacat与消息中心结合使用

hmtdttj4  于 2021-06-06  发布在  Kafka
关注(0)|答案(1)|浏览(388)

在尝试将kafkacat与message hub结合使用时,我使用了以下方法:

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

出现以下错误:

% ERROR: Java JAAS configuration is not supported, see https://github.com/edenhill/librdkafka/wiki/Using-SASL-with-librdkafka for more information.

如何将kerberos与提供的凭据一起使用来创建正确的密钥,然后使用这些密钥来使用主题?

ycl3bljg

ycl3bljg1#

不能将java参数名称与kafkacat一起使用。
您需要改用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>

示例中指定的配置适用于消息中心。 <CERTS_PATH> 取决于您的操作系统:
macos公司: /etc/ssl/cert.pem debian公司: /Ubuntu/IBM Cloud: /etc/ssl/certs/ 红帽: /etc/pki/tls/cert.pem

相关问题