简体   繁体   English

很少有 kafka 分区没有分配给任何 flink 使用者

[英]Few kafka partitions are not getting assigned to any flink consumer

I have a kafka topic with 15 partitions [0-14] and I'm running flink with 5 parallelism.我有一个带有 15 个分区 [0-14] 的 kafka 主题,并且我正在运行具有 5 个并行度的 flink。 So ideally each parallel flink consumer should consume 3 partitions each.所以理想情况下,每个并行 flink 消费者应该每个消耗 3 个分区。 But even after multiple restarts, few of the kafka partitions are not subscribed by any flink workers.但是即使在多次重启之后,也很少有 kafka 分区没有被任何 flink worker 订阅。

org.apache.kafka.clients.consumer.KafkaConsumer assign  Subscribed to partition(s): topic_name-13, topic_name-8, topic_name-9
org.apache.kafka.clients.consumer.KafkaConsumer assign  Subscribed to partition(s): topic_name-11, topic_name-12, topic_name-13
org.apache.kafka.clients.consumer.KafkaConsumer assign  Subscribed to partition(s): topic_name-14, topic_name-0, topic_name-10
org.apache.kafka.clients.consumer.KafkaConsumer assign  Subscribed to partition(s): topic_name-5, topic_name-6, topic_name-10
org.apache.kafka.clients.consumer.KafkaConsumer assign  Subscribed to partition(s): topic_name-2, topic_name-3, topic_name-7

From the above logs, it shows that partitions 10 and 13 have been subscribed by 2 consumers and partition 1 and 4 are not subscribed at all.从上面的日志可以看出,分区 10 和 13 已被 2 个消费者订阅,而分区 1 和 4 根本没有订阅。

Note: If I start the job with 1 parallelism, the job works perfectly fine.注意:如果我以 1 个并行性开始工作,则工作完全正常。

Flink Version: 1.3.3 Flink 版本:1.3.3

This sounds like https://issues.apache.org/jira/browse/FLINK-7143 .这听起来像https://issues.apache.org/jira/browse/FLINK-7143

Reading through the details in the Jira ticket and in the pull request ( https://github.com/apache/flink/pull/4301 ), it sounds like if you are on Flink 1.3.x you can only benefit from this bug fix if you do a fresh restart.通读 Jira 票证和拉取请求( https://github.com/apache/flink/pull/4301 )中的详细信息,听起来如果您使用的是 Flink 1.3.x,您只能从这个错误修复中受益如果您重新启动。 Restarting from a savepoint isn't enough to benefit from the fix.从保存点重新启动不足以从修复中受益。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM