Kafka:一个经纪人保存打印信息日志:“不是分区的领导人”

oewdyzsn  于 2021-06-08  发布在  Kafka
关注(0)|答案(1)|浏览(761)

我用三个代理设置了一个kafka集群,并用参数创建了几个主题——复制因子2——分区1,不生成或使用消息。
但我发现其中一个代理每秒都有连续的输出信息日志,而另外两个代理看起来很好:
[2018-07-09 10:11:17,

743] INFO [ReplicaFetcher replicaId=3, leaderId=128, fetcherId=0] Retrying leaderEpoch request for partition TOPIC_LOGIN_EVENT-0 as the leader reported an error: NOT_LEADER_FOR_PARTITION (kafka.server.ReplicaFetcherThread)
[2018-07-09 10:11:18,744] INFO [ReplicaFetcher replicaId=3, leaderId=128, fetcherId=0] Retrying leaderEpoch request for partition TOPIC_LOGIN_EVENT-0 as the leader reported an error: NOT_LEADER_FOR_PARTITION (kafka.server.ReplicaFetcherThread)
[2018-07-09 10:11:19,744] INFO [ReplicaFetcher replicaId=3, leaderId=128, fetcherId=0] Retrying leaderEpoch request for partition TOPIC_LOGIN_EVENT-0 as the leader reported an error: NOT_LEADER_FOR_PARTITION (kafka.server.ReplicaFetcherThread)
[2018-07-09 10:11:20,745] INFO [ReplicaFetcher replicaId=3, leaderId=128, fetcherId=0] Retrying leaderEpoch request for partition TOPIC_LOGIN_EVENT-0 as the leader reported an error: NOT_LEADER_FOR_PARTITION (kafka.server.ReplicaFetcherThread)
[2018-07-09 10:11:21,746] INFO [ReplicaFetcher replicaId=3, leaderId=128, fetcherId=0] Retrying leaderEpoch request for partition TOPIC_LOGIN_EVENT-0 as the leader reported an error: NOT_LEADER_FOR_PARTITION (kafka.server.ReplicaFetcherThread)
[2018-07-09 10:11:22,746] INFO [ReplicaFetcher replicaId=3, leaderId=128, fetcherId=0] Retrying leaderEpoch request for partition TOPIC_LOGIN_EVENT-0 as the leader reported an error: NOT_LEADER_FOR_PARTITION (kafka.server.ReplicaFetcherThread)
[2018-07-09 10:11:23,747] INFO [ReplicaFetcher replicaId=3, leaderId=128, fetcherId=0] Retrying leaderEpoch request for partition TOPIC_LOGIN_EVENT-0 as the leader reported an error: NOT_LEADER_FOR_PARTITION (kafka.server.ReplicaFetcherThread)
[2018-07-09 10:11:24,747] INFO [ReplicaFetcher replicaId=3, leaderId=128, fetcherId=0] Retrying leaderEpoch request for partition TOPIC_LOGIN_EVENT-0 as the leader reported an error: NOT_LEADER_FOR_PARTITION (kafka.server.ReplicaFetcherThread)
[2018-07-09 10:11:25,748] INFO [ReplicaFetcher replicaId=3, leaderId=128, fetcherId=0] Retrying leaderEpoch request for partition TOPIC_LOGIN_EVENT-0 as the leader reported an error: NOT_LEADER_FOR_PARTITION (kafka.server.ReplicaFetcherThread)
[2018-07-09 10:11:26,749] INFO [ReplicaFetcher replicaId=3, leaderId=128, fetcherId=0] Retrying leaderEpoch request for partition TOPIC_LOGIN_EVENT-0 as the leader reported an error: NOT_LEADER_FOR_PARTITION (kafka.server.ReplicaFetcherThread)
[2018-07-09 10:11:27,749] INFO [ReplicaFetcher replicaId=3, leaderId=128, fetcherId=0] Retrying leaderEpoch request for partition TOPIC_LOGIN_EVENT-0 as the leader reported an error: NOT_LEADER_FOR_PARTITION (kafka.server.ReplicaFetcherThread)
[2018-07-09 10:11:28,750] INFO [ReplicaFetcher replicaId=3, leaderId=128, fetcherId=0] Retrying leaderEpoch request for partition TOPIC_LOGIN_EVENT-0 as the leader reported an error: NOT_LEADER_FOR_PARTITION (kafka.server.ReplicaFetcherThread)
[2018-07-09 10:11:29,750] INFO [ReplicaFetcher replicaId=3, leaderId=128, fetcherId=0] Retrying leaderEpoch request for partition TOPIC_LOGIN_EVENT-0 as the leader reported an error: NOT_LEADER_FOR_PARTITION (kafka.server.ReplicaFetcherThread)
[2018-07-09 10:11:30,751] INFO [ReplicaFetcher replicaId=3, leaderId=128, fetcherId=0] Retrying leaderEpoch request for partition TOPIC_LOGIN_EVENT-0 as the leader reported an error: NOT_LEADER_FOR_PARTITION (kafka.server.ReplicaFetcherThread)
[2018-07-09 10:11:31,752] INFO [ReplicaFetcher replicaId=3, leaderId=128, fetcherId=0] Retrying leaderEpoch request for partition TOPIC_LOGIN_EVENT-0 as the leader reported an error: NOT_LEADER_FOR_PARTITION (kafka.server.ReplicaFetcherThread)
[2018-07-09 10:11:32,752] INFO [ReplicaFetcher replicaId=3, leaderId=128, fetcherId=0] Retrying leaderEpoch request for partition TOPIC_LOGIN_EVENT-0 as the leader reported an error: NOT_LEADER_FOR_PARTITION (kafka.server.ReplicaFetcherThread)
[2018-07-09 10:11:33,753] INFO [ReplicaFetcher replicaId=3, leaderId=128, fetcherId=0] Retrying leaderEpoch request for partition TOPIC_LOGIN_EVENT-0 as the leader reported an error: NOT_LEADER_FOR_PARTITION (kafka.server.ReplicaFetcherThread)
lnlaulya

lnlaulya1#

我找到了问题的根源,我没有配置侦听地址,因此每个代理在默认情况下都使用inetaddress.getlocalhost()绑定它。所以不幸的是,一个拥有主题使用的主要分区的代理”localhost:9092" . 问题代理被告知通过“连接到主分区”localhost:9092,结果连接到自身,当然--不是分区的\u leader\u
我纠正了/etc/hosts,它可以工作

相关问题