消费kafka中的topic时,如果分区大于1就会报错: Attempt to fetch offsets for partition vipInfo-1 failed due to obsolete leadership information, retrying.如果分区是1的话就可以正常消费?有人遇到过这个问题吗?
else if (error == Errors.NOT_LEADER_FOR_PARTITION) {
log.debug("Attempt to fetch offsets for partition {} failed due to obsolete leadership information, retrying.",
topicPartition);
future.raise(error);
}
1 个回复
JackGe
赞同来自:
意思是该topic partition没有找到leader,你需要检查下你创建的topic所有partition的是否正常,使用kafka命令
kafka-topics.sh --describe --zookeeper 127.0.0.1:2181 --topic topicName