Batch containing 1 record(s) expired due to timeout while requesting metadata from brokers

一、异常信息如下:

java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.TimeoutException: Batch containing 1 record(s) expired due to timeout while requesting metadata from brokers for user-video-0

at org.apache.kafka.clients.producer.internals.FutureRecordMetadata.valueOrError(FutureRecordMetadata.java:65)

at org.apache.kafka.clients.producer.internals.FutureRecordMetadata.get(FutureRecordMetadata.java:52)

at org.apache.kafka.clients.producer.internals.FutureRecordMetadata.get(FutureRecordMetadata.java:25)

at kafka.examples.Producer.run(Producer.java:43)

二、异常信息如下:

Failed to send producer request with correlation id 8 to broker 2 with data for partitions [user-video,0]

java.nio.channels.ClosedChannelException

at kafka.network.BlockingChannel.send(BlockingChannel.scala:100) ~[kafka_2.10-0.8.2.0.jar:?]

at kafka.producer.SyncProducer.liftedTree1$1(SyncProducer.scala:73) ~[kafka_2.10-0.8.2.0.jar:?]

at kafka.producer.SyncProducer.kafka$producer$SyncProducer$$doSend(SyncProducer.scala:72) ~[kafka_2.10-0.8.2.0.jar:?]

at kafka.producer.SyncProducer$$anonfun$send$1$$anonfun$apply$mcV$sp$1.apply$mcV$sp(SyncProducer.scala:103) ~[kafka_2.10-0.8.2.0.jar:?]

at kafka.producer.SyncProducer$$anonfun$send$1$$anonfun$apply$mcV$sp$1.apply(SyncProducer.scala:103) ~[kafka_2.10-0.8.2.0.jar:?]

at kafka.producer.SyncProducer$$anonfun$send$1$$anonfun$apply$mcV$sp$1.apply(SyncProducer.scala:103) ~[kafka_2.10-0.8.2.0.jar:?]

at kafka.metrics.KafkaTimer.time(KafkaTimer.scala:33) ~[kafka_2.10-0.8.2.0.jar:?]

at kafka.producer.SyncProducer$$anonfun$send$1.apply$mcV$sp(SyncProducer.scala:102) ~[kafka_2.10-0.8.2.0.jar:?]

at kafka.producer.SyncProducer$$anonfun$send$1.apply(SyncProducer.scala:102) ~[kafka_2.10-0.8.2.0.jar:?]

at kafka.producer.SyncProducer$$anonfun$send$1.apply(SyncProducer.scala:102) ~[kafka_2.10-0.8.2.0.jar:?]

at kafka.metrics.KafkaTimer.time(KafkaTimer.scala:33) ~[kafka_2.10-0.8.2.0.jar:?]

at kafka.producer.SyncProducer.send(SyncProducer.scala:101) ~[kafka_2.10-0.8.2.0.jar:?]

at kafka.producer.async.DefaultEventHandler.kafka$producer$async$DefaultEventHandler$$send(DefaultEventHandler.scala:255) [kafka_2.10-0.8.2.0.jar:?]

at kafka.producer.async.DefaultEventHandler$$anonfun$dispatchSerializedData$2.apply(DefaultEventHandler.scala:106) [kafka_2.10-0.8.2.0.jar:?]

at kafka.producer.async.DefaultEventHandler$$anonfun$dispatchSerializedData$2.apply(DefaultEventHandler.scala:100) [kafka_2.10-0.8.2.0.jar:?]

at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:772) [scala-library-2.10.4.jar:?]

at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:98) [scala-library-2.10.4.jar:?]

at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:98) [scala-library-2.10.4.jar:?]

at scala.collection.mutable.HashTable$class.foreachEntry(HashTable.scala:226) [scala-library-2.10.4.jar:?]

at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:39) [scala-library-2.10.4.jar:?]

at scala.collection.mutable.HashMap.foreach(HashMap.scala:98) [scala-library-2.10.4.jar:?]

at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:771) [scala-library-2.10.4.jar:?]

at kafka.producer.async.DefaultEventHandler.dispatchSerializedData(DefaultEventHandler.scala:100) [kafka_2.10-0.8.2.0.jar:?]

at kafka.producer.async.DefaultEventHandler.handle(DefaultEventHandler.scala:72) [kafka_2.10-0.8.2.0.jar:?]

at kafka.producer.Producer.send(Producer.scala:77) [kafka_2.10-0.8.2.0.jar:?]

at kafka.javaapi.producer.Producer.send(Producer.scala:33) [kafka_2.10-0.8.2.0.jar:?]

at kafka.example.kafkaProducer.run(kafkaProducer.java:24) [classes/:?]

Back off for 100 ms before retrying send. Remaining retries = 1

从这两个异常信息,都是网络问题导致的,如果在本地测试出现该异常,把代码放到集群上测试,如果集群可以看防火墙,如果还不行,在本地hosts文件中添加 主机 主机名称对应关系。

时间: 2024-11-14 15:11:09

Batch containing 1 record(s) expired due to timeout while requesting metadata from brokers的相关文章

Batch containing 11 record(s) expired due to timeo

背景:Kafka集群在一个192.168.0.x网段的,而我们的生产者在192.168.17.x网段的一台机器上,故当生产者发送消息给Kafka时,无法将消息发送过去. 错误:11:21:13,936 ERROR KafkaProducer - Batch containing 11 record(s) expired due to timeout while requesting metadata from brokers for onlinelogs-1 分析:1.做Kafka集群的demo

MySQL异常:Caused by: com.mysql.jdbc.exceptions.MySQLTimeoutException: Statement cancelled due to timeout or client request

Caused by: com.mysql.jdbc.exceptions.MySQLTimeoutException: Statement cancelled due to timeout or client request at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2303) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2696) at com.mys

Statement cancelled due to timeout or client request

tomcat日志报错: org.springframework.dao.QueryTimeoutException: ### Error querying database. Cause: com.mysql.jdbc.exceptions.MySQLTimeoutException: Statement cancelled due to timeout or client request### The error may exist in file [/var/lib/tomcat8/weba

使用Larave5.6l提交POST请求出现The page has expired due to inactivity错误

一般是由于没有添加 csrf造成的 在表单下面的 第一个行 添加如下代码即可 <input type="hidden" name="_token" value="{{csrf_token()}}"> 切记是第一行 如果还有问题,那么检查form下的 第一行是不是以上数据  如果有其他的数据请放到别的行 原文地址:https://www.cnblogs.com/baker95935/p/9300388.html

阿里云上部署kafka--遇到的坑

阿里云防火墙关闭,并且配置规则.不然会导致访问不到服务. 问题一: Caused by: java.net.UnknownHostException: iZuf68tztea6l5ccdz7wemZ: iZuf68tztea6l5ccdz7wemZ: Name or service not known vi /etc/hosts 127.0.0.1 iZuf68tztea6l5ccdz7wemZ iZuf68tztea6l5ccdz7wemZ 自己的主机名 问题二: ERROR Error wh

kafka+windows+java+springboot中的配置

1.百度kafka+zookeeper+windows配置 1.1  zookeeper配置 dataDir=/tmp/zookeeper # the port at which the clients will connect clientPort=2181 # disable the per-ip limit on the number of connections since this is a non-production config maxClientCnxns=0 1.2 kafk

【转载】Hadoop官方文档翻译——HDFS Architecture 2.7.3

HDFS Architecture HDFS Architecture(HDFS 架构) Introduction(简介) Assumptions and Goals(假设和目标) Hardware Failure(硬件失效是常态) Streaming Data Access(支持流式访问) Large Data Sets(大数据集) Simple Coherency Model(简单一致性模型) “Moving Computation is Cheaper than Moving Data”(

Cryptographic method and system

The present invention relates to the field of security of electronic data and/or communications. In one form, the invention relates to data security and/or privacy in a distributed and/or decentralised network environment. In another form, the invent

Kafka源码分析及图解原理之Producer端

一.前言 任何消息队列都是万变不离其宗都是3部分,消息生产者(Producer).消息消费者(Consumer)和服务载体(在Kafka中用Broker指代).那么本篇主要讲解Producer端,会有适当的图解帮助理解底层原理. 一.开发应用 首先介绍一下开发应用,如何构建一个KafkaProducer及使用,还有一些重要参数的简介. 1.1 一个栗子 1 /** 2 * Kafka Producer Demo实例类. 3 * 4 * @author GrimMjx 5 */ 6 public