[英]kafka + This server is not the leader for that topic-partition + kafka producer
我们从3
kafka 机器中的每台(我们在集群中有3
kafka )的server.log
中得到很多错误
[2019-12-05 13:25:09,529] ERROR [ReplicaFetcherThread-0-1], Error for partition [jdty.dee.rules.time,91] to broker 1001:org.apache.kafka.common.errors.NotLeaderForPartitionException: This server is not the leader for that topic-partition. (kafka.server.ReplicaFetcherThread)
[2019-12-05 13:25:09,529] ERROR [ReplicaFetcherThread-0-1], Error for partition [jdty.dee.export.profiles,96] to broker 1001:org.apache.kafka.common.errors.NotLeaderForPartitionException: This server is not the leader for that topic-partition. (kafka.server.ReplicaFetcherThread)
[2019-12-05 13:25:09,529] ERROR [ReplicaFetcherThread-0-1], Error for partition [jdty.dee.control.tt.state,40] to broker 1001:org.apache.kafka.common.errors.NotLeaderForPartitionException: This server is not the leader for that topic-partition. (kafka.server.ReplicaFetcherThread)
[2019-12-05 13:25:09,529] ERROR [ReplicaFetcherThread-0-1], Error for partition [jdty.dee.control.tt,67] to broker 1001:org.apache.kafka.common.errors.NotLeaderForPartitionException: This server is not the leader for that topic-partition. (kafka.server.ReplicaFetcherThread)
根据我的理解,每个主题都由一个或多个 Broker 提供服务——一个是领导者,其余的经纪人是追随者。
生产者需要向领导者代理发送新消息,后者在内部将数据复制到所有追随者。
我假设,你的生产者客户端没有连接到正确的 Broker,它连接到一个跟随者而不是领导者,并且这个跟随者拒绝你的发送请求。
所以我的问题是 - 如何配置生产者配置以避免此类错误?
追随者经纪人从领导者经纪人处获取(领导者不推送给追随者)。 因此,似乎追随者经纪人试图从错误的(领导者)经纪人那里获取信息。 发生这种情况的原因是分区的领导者发生了变化。 相应的跟随者代理应自动更新其集群元数据以重新发现新的领导者。 如果错误仍然存在,则表明此跟随者代理在更新其元数据方面存在问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.