当前位置:   article > 正文

kafka启用SASL认证后使用kafka-consumer-groups.sh查看消费组报错的问题_kafka-consumer-groups.sh sasl

kafka-consumer-groups.sh sasl

解决SASL认证类型kafka在使用kafka-consumer-groups.sh查看消费组数据时,报以下异常的问题

  1. Error: Executing consumer group command failed due to org.apache.kafka.common.errors.TimeoutException: Timed out waiting for a node assignment.
  2. java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.TimeoutException: Timed out waiting for a node assignment.
  3. at org.apache.kafka.common.internals.KafkaFutureImpl.wrapAndThrow(KafkaFutureImpl.java:45)
  4. at org.apache.kafka.common.internals.KafkaFutureImpl.access$000(KafkaFutureImpl.java:32)
  5. at org.apache.kafka.common.internals.KafkaFutureImpl$SingleWaiter.await(KafkaFutureImpl.java:89)
  6. at org.apache.kafka.common.internals.KafkaFutureImpl.get(KafkaFutureImpl.java:262)
  7. at kafka.admin.ConsumerGroupCommand$ConsumerGroupService.collectGroupOffsets(ConsumerGroupCommand.scala:332)
  8. at kafka.admin.ConsumerGroupCommand$ConsumerGroupService.describeGroup(ConsumerGroupCommand.scala:252)
  9. at kafka.admin.ConsumerGroupCommand$.main(ConsumerGroupCommand.scala:60)
  10. at kafka.admin.ConsumerGroupCommand.main(ConsumerGroupCommand.scala)
  11. Caused by: org.apache.kafka.common.errors.TimeoutException: Timed out waiting for a node assignment.

解决方案:

进入docker容器,非docker部署进入kafka安装地址即可:

进入容器 docker exec -it kafka容器ID bash

进入kafka的配置config文件夹:

cd   /home/zk/kafka_2.11-2.1.1/config

执行命令:

vi consumer-group-ssl.properties

输入内容并保存:

  1. security.protocol=SASL_PLAINTEXT
  2. sasl.mechanism=SCRAM-SHA-512
  3. sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required username="账号" password="密码";

如图:

 保存配置文件consumer-group-ssl.properties

接着执行命令:

cd   /home/zk/kafka_2.11-2.1.1
./bin/kafka-consumer-groups.sh  --describe --bootstrap-server kafka的IP:kafka的端口--command-config config/consumer-group-ssl.properties --group test-group

 查询消费组数据成功!

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/神奇cpp/article/detail/816116
推荐阅读
相关标签
  

闽ICP备14008679号