【发布时间】:2019-06-12 04:50:31
【问题描述】:
我有一个 3 个节点的 kafka 集群。当节点 #3 死亡时,我的 _schemas 主题停止正常运行,我看到了:
kafka-topics --zookeeper localhost:2181 --topic _schemas --describe
Topic:_schemas PartitionCount:1 ReplicationFactor:2 Configs:cleanup.policy=compact
Topic: _schemas Partition: 0 Leader: -1 Replicas: 3,2 Isr: 2
所以看起来节点 #3 已经死了,这就是 Leader: -1 所指的。但是为什么 Kafka 不继续像往常一样继续工作,将 Node #2 分配为新的领导者并将数据复制到 #1 以便我们有 2 个同步副本?
我在 kafka 日志中看到的错误:
kafka.common.NotAssignedReplicaException:
Leader 3 failed to record follower 2's position -1 since the replica is not
recognized to be one of the assigned replicas 3 for partition <loop over many partitions>
【问题讨论】:
-
我使用的Kafka版本是
0.11,类似的错误,但我怎么知道? -
重启其他节点(1和2)实际上有助于解决问题
-
检查 controller.log 看看出了什么问题以及为什么控制器没有为 [_schemas,0] 选择新的领导者。
标签: apache-kafka