Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache kafka 组中的成员无法(重新)加入卡夫卡中的组_Apache Kafka_Kafka Consumer Api - Fatal编程技术网

Apache kafka 组中的成员无法(重新)加入卡夫卡中的组

Apache kafka 组中的成员无法(重新)加入卡夫卡中的组,apache-kafka,kafka-consumer-api,Apache Kafka,Kafka Consumer Api,我的应用程序正在阅读卡夫卡的一个主题,在对其进行充实后,它会将其保存到另一个主题。StreamsConfig.NUM\u STREAM\u THREADS\u CONFIG配置为8。我有两个代理和12个分区 Topic: enriched-request PartitionCount: 12 ReplicationFactor: 2 Configs: min.insync.replicas=1,flush.ms=86400000,segment.bytes=1073741824,flus

我的应用程序正在阅读卡夫卡的一个主题,在对其进行充实后,它会将其保存到另一个主题。
StreamsConfig.NUM\u STREAM\u THREADS\u CONFIG
配置为
8
。我有两个代理和12个分区

Topic: enriched-request PartitionCount: 12  ReplicationFactor: 2    Configs: min.insync.replicas=1,flush.ms=86400000,segment.bytes=1073741824,flush.messages=1073741824,max.message.bytes=1000000,index.interval.bytes=4096,unclean.leader.election.enable=false,retention.bytes=-1,delete.retention.ms=259200000,segment.ms=604800000,segment.index.bytes=10485760
    Topic: enriched-request Partition: 0    Leader: 7   Replicas: 7,8   Isr: 7,8
    Topic: enriched-request Partition: 1    Leader: 8   Replicas: 8,7   Isr: 7,8
    Topic: enriched-request Partition: 2    Leader: 7   Replicas: 7,8   Isr: 7,8
    Topic: enriched-request Partition: 3    Leader: 8   Replicas: 8,7   Isr: 7,8
    Topic: enriched-request Partition: 4    Leader: 7   Replicas: 7,8   Isr: 7,8
    Topic: enriched-request Partition: 5    Leader: 8   Replicas: 8,7   Isr: 7,8
    Topic: enriched-request Partition: 6    Leader: 7   Replicas: 7,8   Isr: 7,8
    Topic: enriched-request Partition: 7    Leader: 8   Replicas: 8,7   Isr: 7,8
    Topic: enriched-request Partition: 8    Leader: 7   Replicas: 7,8   Isr: 7,8
    Topic: enriched-request Partition: 9    Leader: 8   Replicas: 8,7   Isr: 7,8
    Topic: enriched-request Partition: 10   Leader: 7   Replicas: 7,8   Isr: 7,8
    Topic: enriched-request Partition: 11   Leader: 8   Replicas: 8,7   Isr: 7,8
在我的测试环境中两周后,我收到了以下日志消息:
INFO AbstractCoordinator:336-[Consumer-clientId=my-enrichments-client-StreamThread-4-Consumer,groupId=my-enrichments](重新)加入组
,这是我为所有8个线程得到的。每5分钟触发一次,每次触发一组新的8个线程

在我的
kafka.log
中,我看到:
组my enrichments中的成员my-enrichments-client-StreamThread-4-consumer-6409090a-9d06-4bc0-8dd0-cd4c8bd28d71失败,再次将其从组中删除(kafka.coordinator.group.GroupCoordinator)
。与上面相同,每5分钟这些都是它正在移除的8个线程的新集合

在我的测试环境中只有一个应用程序正在运行。我试着等待15-20分钟来重新部署,但我总是遇到同样的错误。有人知道我如何解决这个问题而不必更改
StreamsConfig.CLIENT\u ID\u CONFIG
StreamsConfig.APPLICATION\u ID\u CONFIG

消费者配置

final Properties streamsConfiguration = new Properties();
streamsConfiguration.put(StreamsConfig.APPLICATION_ID_CONFIG, "my-enrichments");
streamsConfiguration.put(StreamsConfig.CLIENT_ID_CONFIG, "my-enrichments-client");
streamsConfiguration.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, my bootstrap sersvers);
streamsConfiguration.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");
streamsConfiguration.put(StreamsConfig.DEFAULT_TIMESTAMP_EXTRACTOR_CLASS_CONFIG, WallclockTimestampExtractor.class.getName());
streamsConfiguration.put(StreamsConfig.NUM_STREAM_THREADS_CONFIG, 8);
streamsConfiguration.put(ProducerConfig.COMPRESSION_TYPE_CONFIG, "snappy");

如果它有什么帮助的话,那就是在我将线程数从
3
增加到
8
后的一周左右开始发生的。我不知道它是否与此相关。

由于找不到答案,我尝试了以下方法:

  • 描述小组
    bin/kafka-consumer-groups.sh--引导服务器我的kafka服务器:9092--描述--对我的丰富内容进行分组
    。有了这个,我得到了警告:消费者群体“我的财富”正在重新平衡。
  • 删除它
    bin/kafka-consumer-groups.sh--引导服务器我的kafka服务器:9092--删除--对我的丰富内容进行分组
    这导致了错误:
  • 重新启动代理修复了该问题

  • 你能分享你消费者的配置吗?@giorgosmyriantous我添加了配置你对
    max.poll.interval.ms
    的配置是什么?@giorgosmyriantous默认值可能是
    300000
    Error: Deletion of some consumer groups failed:
    * Group 'my-enrichments' could not be deleted due to: java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.GroupNotEmptyException: The group is not empty.