kafka有台broker挂机之后长时间没重启,导致重启报错

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/hblicy/article/details/89480739

2019-04-23 17:22:42,423 WARN kafka.controller.KafkaController: [Controller 782]: Partition [hjw_test8,6] failed to complete preferred replica leader election. Leader is 201
2019-04-23 17:22:42,423 ERROR kafka.server.ReplicaFetcherThread: [ReplicaFetcherThread-5-203], Error for partition [alarm_callback_topic,2] to broker 203:org.apache.kafka.common.errors.Not
LeaderForPartitionException: This server is not the leader for that topic-partition.
2019-04-23 17:22:42,426 ERROR state.change.logger: Controller 782 epoch 227 encountered error while electing leader for partition [004_8,3] due to: Preferred replica 203 for partition [004
_8,3] is either not alive or not in the isr. Current leader and ISR: [{"leader":759,"leader_epoch":3,"isr":[759]}].
2019-04-23 17:22:42,426 ERROR state.change.logger: Controller 782 epoch 227 initiated state change for partition [004_8,3] from OfflinePartition to OnlinePartition failed
kafka.common.StateChangeFailedException: encountered error while electing leader for partition [004_8,3] due to: Preferred replica 203 for partition [004_8,3] is either not alive or not in
 the isr. Current leader and ISR: [{"leader":759,"leader_epoch":3,"isr":[759]}].

2019-04-23 17:22:42,430 ERROR kafka.server.ReplicaFetcherThread: [ReplicaFetcherThread-1-203], Error for partition [kjTest,8] to broker 203:org.apache.kafka.common.errors.NotLeaderForParti
tionException: This server is not the leader for that topic-partition.
2019-04-23 17:22:42,430 ERROR kafka.server.ReplicaFetcherThread: [ReplicaFetcherThread-1-203], Error for partition [app_error_log,2] to broker 203:org.apache.kafka.common.errors.NotLeaderF
orPartitionException: This server is not the leader for that topic-partition.
2019-04-23 17:22:42,430 ERROR kafka.server.ReplicaFetcherThread: [ReplicaFetcherThread-1-203], Error for partition [kjTest2,8] to broker 203:org.apache.kafka.common.errors.NotLeaderForPart
itionException: This server is not the leader for that topic-partition.
2019-04-23 17:22:42,430 ERROR kafka.server.ReplicaFetcherThread: [ReplicaFetcherThread-1-203], Error for partition [fj1001,9] to broker 203:org.apache.kafka.common.errors.NotLeaderForParti
tionException: This server is not the leader for that topic-partition.
2019-04-23 17:22:42,430 ERROR kafka.server.ReplicaFetcherThread: [ReplicaFetcherThread-1-203], Error for partition [lzsw_alarm_topic,1] to broker 203:org.apache.kafka.common.errors.NotLead
erForPartitionException: This server is not the leader for that topic-partition.

[Kafka Server 782], Proceeding to do an unclean shutdown as all the controlled shutdown attempts failed

遇到这个问题,有可能是副本的offset比leader的新,导致的不能启动

使用命令直接平衡所有的topic

kafka-preferred-replica-election.sh --zookeeper 192.168.3.201:2181

猜你喜欢

转载自blog.csdn.net/hblicy/article/details/89480739