[我们从每台server.log
kafka机器的3
中得到很多错误(我们在集群中有3
kafka]
[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)
根据我的理解,每个主题都由一个或多个经纪人提供服务-一个是领导者,其余的经纪人是跟随者。
生产者需要向领导者经纪人发送新消息,领导者经纪人将数据内部复制到所有关注者。
[我假设您的生产者客户端未连接到正确的代理,其连接到关注者而不是领导者,并且该关注者拒绝了您的发送请求。
所以我的问题是-如何配置生产者配置以避免这些错误?
跟随经纪人从领导经纪人那里获取(领导者不向追随者推销)。因此,似乎追随者经纪人试图从错误的(领导者)经纪人那里获取信息。分区领导者发生这种情况可能会发生。相应的跟随者代理应自动更新其集群元数据以重新发现新的领导者。如果错误仍然存在,则表明此追随者经纪人有更新其元数据的问题。