简体   繁体   English

kafka-flink:Kafka生产者错误,取决于flink作业

[英]kafka-flink : Kafka producer error depending on flink jobs

While I was doing a proof of concept with kafka-flink, I discovered the following : It seems that kafka producer errors could happen due to workload done on flink side ?! 当我使用kafka-flink进行概念验证时,我发现了以下内容:似乎由于flink方面的工作量,kafka生产者错误可能会发生?

Here are more details: 以下是更多详细信息:

I have sample files like sample??.EDR made of ~700'000 rows with values like "entity", "value", "timestamp" 我有示例文件,例如sample ??。EDR,由约700'000行组成,其值包含“ entity”,“ value”,“ timestamp”

I use the following command to create the kafka topic: 我使用以下命令创建kafka主题:

~/kafka/bin/kafka-topics.sh --create --zookeeper localhost:2181 --partitions 1 --replication-factor 1 --topic gprs

I use the following command to load sample files on topic: 我使用以下命令加载有关主题的样本文件:

[13:00] kafka@ubu19: ~/fms
% /home/kafka/kafka/bin/kafka-console-producer.sh --broker-list localhost:9092 --topic gprs < ~/sample/sample01.EDR

I have on flink side jobs that aggregate value for each entity with sliding window of 6 hours and 72 hours (aggregationeachsix, aggregationeachsentytwo). 我在flink方面的工作中,每个实体通过6个小时和72个小时的滑动窗口来汇总价值(aggregationeachsix,aggregationeachsentytwo)。

I did three scenarios: 我做了三种情况:

  1. Load files in the topic without any job running 加载主题中的文件,而无需运行任何作业
  2. Load files in the topic with aggregationeachsix job running 在运行Aggregationeachsix作业的情况下加载主题中的文件
  3. Load files in the topic with aggregationeachsix and aggregationeachsentytwo jobs running 通过运行aggregationeachsix和aggregationeachsentytwo作业来加载主题中的文件

The results is that first two scenarios are working but for the third scenario, I have the following errors on kafka producer side while loading the files (not always at the same file, it can be the first, second, third or even later file): 结果是前两种情况都可以使用,但对于第三种情况,我在kafka生产者端在加载文件时遇到以下错误(并非总是在同一文件中,它可以是第一个,第二个,第三个甚至更高版本的文件) :

    [plenty of lines before this part]
    [2017-08-09 12:56:53,409] ERROR Error when sending message to topic gprs with key: null, value: 35 bytes with error: (org.apache.kafka.clients.producer.internals.ErrorLoggingCallback)
    org.apache.kafka.common.errors.TimeoutException: Expiring 233 record(s) for gprs-0: 1560 ms has passed since last append
    [2017-08-09 12:56:53,409] ERROR Error when sending message to topic gprs with key: null, value: 37 bytes with error: (org.apache.kafka.clients.producer.internals.ErrorLoggingCallback)
    org.apache.kafka.common.errors.TimeoutException: Expiring 233 record(s) for gprs-0: 1560 ms has passed since last append
    [2017-08-09 12:56:53,409] ERROR Error when sending message to topic gprs with key: null, value: 37 bytes with error: (org.apache.kafka.clients.producer.internals.ErrorLoggingCallback)
    org.apache.kafka.common.errors.TimeoutException: Expiring 233 record(s) for gprs-0: 1560 ms has passed since last append
    [2017-08-09 12:56:53,412] WARN Got error produce response with correlation id 1627 on topic-partition gprs-0, retrying (2 attempts left). Error: NETWORK_EXCEPTION (org.apache.kafka.clients.producer.internals.Sender)
    [2017-08-09 12:56:53,412] WARN Got error produce response with correlation id 1626 on topic-partition gprs-0, retrying (2 attempts left). Error: NETWORK_EXCEPTION (org.apache.kafka.clients.producer.internals.Sender)
    [2017-08-09 12:56:53,412] WARN Got error produce response with correlation id 1625 on topic-partition gprs-0, retrying (2 attempts left). Error: NETWORK_EXCEPTION (org.apache.kafka.clients.producer.internals.Sender)
    [2017-08-09 12:56:53,412] WARN Got error produce response with correlation id 1624 on topic-partition gprs-0, retrying (2 attempts left). Error: NETWORK_EXCEPTION (org.apache.kafka.clients.producer.internals.Sender)
    [2017-08-09 12:56:53,515] ERROR Error when sending message to topic gprs with key: null, value: 35 bytes with error: (org.apache.kafka.clients.producer.internals.ErrorLoggingCallback)
    org.apache.kafka.common.errors.TimeoutException: Expiring 8 record(s) for gprs-0: 27850 ms has passed since batch creation plus linger time
    [2017-08-09 12:56:53,515] ERROR Error when sending message to topic gprs with key: null, value: 37 bytes with error: (org.apache.kafka.clients.producer.internals.ErrorLoggingCallback)
    org.apache.kafka.common.errors.TimeoutException: Expiring 8 record(s) for gprs-0: 27850 ms has passed since batch creation plus linger time
    [plenty of lines after this part]

My question is why flink could have an impact on kafka producer and then, what do I need to change to avoid this error ? 我的问题是,为什么flink可能会对kafka生产者产生影响,然后,为了避免该错误,我需要进行哪些更改?

当flink和kafka-producer都使用网络时,看起来好像已经使网络饱和,因此您会收到TimeoutExceptions

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

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