解决SASL认证类型kafka在使用kafka-consumer-groups.sh查看消费组数据时,报以下异常的问题
Error: Executing consumer group command failed due to org.apache.kafka.common.errors.TimeoutException: Timed out waiting for a node assignment.
java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.TimeoutException: Timed out waiting for a node assignment.
at org.apache.kafka.common.internals.KafkaFutureImpl.wrapAndThrow(KafkaFutureImpl.java:45)
at org.apache.kafka.common.internals.KafkaFutureImpl.access$000(KafkaFutureImpl.java:32)
at org.apache.kafka.common.internals.KafkaFutureImpl$SingleWaiter.await(KafkaFutureImpl.java:89)
at org.apache.kafka.common.internals.KafkaFutureImpl.get(KafkaFutureImpl.java:262)
at kafka.admin.ConsumerGroupCommand$ConsumerGroupService.collectGroupOffsets(ConsumerGroupCommand.scala:332)
at kafka.admin.ConsumerGroupCommand$ConsumerGroupService.describeGroup(ConsumerGroupCommand.scala:252)
at kafka.admin.ConsumerGroupCommand$.main(ConsumerGroupCommand.scala:60)
at kafka.admin.ConsumerGroupCommand.main(ConsumerGroupCommand.scala)
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
输入内容并保存:
security.protocol=SASL_PLAINTEXT
sasl.mechanism=SCRAM-SHA-512
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文章来源:https://www.toymoban.com/news/detail-728623.html
查询消费组数据成功!文章来源地址https://www.toymoban.com/news/detail-728623.html
到了这里,关于kafka启用SASL认证后使用kafka-consumer-groups.sh查看消费组报错的问题的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!