通过命令:./bin/kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list localhost:9092 --topic test001获取主题当前偏移量信息时报错:java.io.EOFException

落羽 发表于: 2020-06-17   最后更新时间: 2020-06-17 13:49:27   2,764 游览

错误信息如下:

WARN Fetching topic metadata with correlation id 0 for topics [Set(test001)] from broker [BrokerEndPoint(0,localhost,9095)] failed (kafka.client.ClientUtils$)
java.io.EOFException
at org.apache.kafka.common.network.NetworkReceive.readFromReadableChannel(NetworkReceive.java:87)
at kafka.network.BlockingChannel.readCompletely(BlockingChannel.scala:131)
at kafka.network.BlockingChannel.receive(BlockingChannel.scala:122)
at kafka.producer.SyncProducer.liftedTree1$1(SyncProducer.scala:82)
at kafka.producer.SyncProducer.kafka$producer$SyncProducer$$doSend(SyncProducer.scala:79)
at kafka.producer.SyncProducer.send(SyncProducer.scala:124)
at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:61)
at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:96)
at kafka.tools.GetOffsetShell$.main(GetOffsetShell.scala:79)
at kafka.tools.GetOffsetShell.main(GetOffsetShell.scala)
Exception in thread "main" kafka.common.KafkaException: fetching topic metadata for topics [Set(test001)] from broker [ArrayBuffer(BrokerEndPoint(0,localhost,9095))] failed
at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:75)
at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:96)
at kafka.tools.GetOffsetShell$.main(GetOffsetShell.scala:79)
at kafka.tools.GetOffsetShell.main(GetOffsetShell.scala)
Caused by: java.io.EOFException
at org.apache.kafka.common.network.NetworkReceive.readFromReadableChannel(NetworkReceive.java:87)
at kafka.network.BlockingChannel.readCompletely(BlockingChannel.scala:131)
at kafka.network.BlockingChannel.receive(BlockingChannel.scala:122)
at kafka.producer.SyncProducer.liftedTree1$1(SyncProducer.scala:82)
at kafka.producer.SyncProducer.kafka$producer$SyncProducer$$doSend(SyncProducer.scala:79)
at kafka.producer.SyncProducer.send(SyncProducer.scala:124)
at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:61)
... 3 more

求大佬帮助解决!!!

发表于 2020-06-17

你kafka上面版本,这种只有offset存储在zk上才有效果。
默认是kafka版本是0.9之前。

落羽 -> 半兽人 4年前

噢噢,目前用的kafka版本是0.11.0.0

一笑而过 -> 落羽 4年前

那要如何查看某个分区的最大(小)偏移量呢?

半兽人 -> 落羽 3年前

你的端口错了吧

./bin/kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list localhost:9092 --topic test001

报错的端口而是9095

落羽 -> 半兽人 3年前

嗯呢,配置文件端口被改了

你的答案

查看kafka相关的其他问题或提一个您自己的问题