簡體   English   中英

kafka + 此服務器不是該主題分區的領導者 + kafka 生產者

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM