0

我們有3卡夫卡經紀人和主題與40個分區和複製因子設置爲1.在一些分區失控的卡夫卡經紀人關閉後,我們看到,它是不可能選出新的領導者(請參閱下面的日誌)。最終我們無法讀到這個話題。 請注意,如果可以在不改變複製因子大於1的情況下倖存這種類型的崩潰。卡夫卡分區領導人選舉失敗後,不受控制的經紀人關機

我們希望我們的目標數據庫具有一致的狀態(基於kafka主題的事件創建),所以我們還將參數unclean.leader.election.enable設置爲false。撞車後

分區信息:

extenr-topic:1:882091242 
extenr-topic:19:882091615 
extenr-topic:28:882092273 
Error: partition 18 does not have a leader. Skip getting offsets 
Error: partition 27 does not have a leader. Skip getting offsets 
Error: partition 36 does not have a leader. Skip getting offsets 

從卡夫卡經紀人例外:

2017-10-09 05:56:50,302 ERROR state.change.logger: Controller 236 epoch 267 initiated state change for partition [extenr-topic,15] from OfflinePartition to OnlinePartition failed 
kafka.common.NoReplicaOnlineException: No broker in ISR for partition [extenr-topic,15] is alive. Live brokers are: [Set(236, 237)], ISR brokers are: [235] 
at kafka.controller.OfflinePartitionLeaderSelector.selectLeader(PartitionLeaderSelector.scala:66) 
at kafka.controller.PartitionStateMachine.electLeaderForPartition(PartitionStateMachine.scala:342) 
at kafka.controller.PartitionStateMachine.kafka$controller$PartitionStateMachine$$handleStateChange(PartitionStateMachine.scala:203) 
at kafka.controller.PartitionStateMachine$$anonfun$triggerOnlinePartitionStateChange$3.apply(PartitionStateMachine.scala:118) 
at kafka.controller.PartitionStateMachine$$anonfun$triggerOnlinePartitionStateChange$3.apply(PartitionStateMachine.scala:115) 
at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:733) 
at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:99) 
at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:99) 

有也是繼日誌

2017-10-09 04:11:25,509 ERROR state.change.logger: Broker 235 received LeaderAndIsrRequest with correlation id 1 from controller 236 epoch 267 for partition [extenr-topic,36] but cannot become follower since the new leader -1 is unavailable. 

回答

0

分區有1爲replication.factor將成爲錯誤當他們的領導者崩潰/關閉時離線,因爲沒有其他人r可用副本接管。

如果可用性對您很重要,我建議增加複製因子。推薦CONFIGS [1]高可用性replication.factor設置爲3,min.insync.replicas設置爲2

1:http://kafka.apache.org/documentation/#brokerconfigs

+0

謝謝你的答案。我們增加了replication.factor,我們正在觀察這個集羣。 – andrzej

相關問題