kafka server.log不停报错 org.apache.kafka.common.errors.UnknownTopicOrPartitionException: This server does not host this topic-partition

小白晒太阳 发表于: 2017-05-24   最后更新时间: 2022-06-29 23:22:24   9,634 游览
[2017-05-24 17:49:14,043] ERROR [ReplicaFetcherThread-0-177], Error for partition [__consumer_offsets,20] to broker 177:org.apache.kafka.common.errors.UnknownTopicOrPartitionException: This server does not host this topic-partition. (kafka.server.ReplicaFetcherThread)
[2017-05-24 17:49:14,043] ERROR [ReplicaFetcherThread-0-177], Error for partition [__consumer_offsets,5] to broker 177:org.apache.kafka.common.errors.UnknownTopicOrPartitionException: This server does not host this topic-partition. (kafka.server.ReplicaFetcherThread)
[2017-05-24 17:49:14,043] ERROR [ReplicaFetcherThread-0-177], Error for partition [__consumer_offsets,35] to broker 177:org.apache.kafka.common.errors.UnknownTopicOrPartitionException: This server does not host this topic-partition. (kafka.server.ReplicaFetcherThread)
[2017-05-24 17:49:14,043] ERROR [ReplicaFetcherThread-0-177], Error for partition [__consumer_offsets,2] to broker 177:org.apache.kafka.common.errors.UnknownTopicOrPartitionException: This server does not host this topic-partition. (kafka.server.ReplicaFetcherThread)
发表于 2017-05-24
添加评论

没找到对应的topic分区,意思就是你的topic或者分区不存在。

  1. 检查下是否关闭了自动创建topic,如果关闭了,就需要你手动创建topic了。
  2. 查看下对应的topic是否正常。

你好,我是禁用自动创建Topic的,我在kafka加了一些ACL的一些配置:

auto.create.topics.enable=false
allow.everyone.if.no.acl.found=false
authorizer.class.name=kafka.security.auth.SimpleAclAuthorizer

我有一个TOPIC sms,我想在集群以外的一台机器B上监测sms的offset和lag值

我在集群上给B机器开通了DESCRIBE的权限,然后在B机器上利用以下脚本去获取offset值

bin/kafka-run-class.sh kafka.tools.ConsumerOffsetChecker -zookeeper ${zk} -topic ${topic} -group ${group}

值都能正常获取,但是运行脚本以后,集群好像就自动创建了__consumer_offsets topic,然后log就不断打印错误。

集群是正常工作的。

kafka版本9.0之后,kafka的offset默认存储在了kafka中,就是你看到的__consumer_offsets,所以必须要创建,不然你会一直报错的。

你的答案

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