kafka分区leader切换
kafka+storm构架
kafka 版本kafka_2.10-0.8.2.1,topic 副本数为2。zk版本3.4.6,storm版本apache-storm-0.9.4
近期storm消费总发现下面这样的报错:storm.kafka.FailedFetchException: Error fetching data from [Partition{host=xx.xx.xx.xx:9092, partition=11}] for topic [test]: [NOT_LEADER_FOR_PARTITION] at storm.kafka.KafkaUtils.fetchMessages
通过kafka-topics.sh --zookeeper localhost --describe,发现主从分区总有切换,如原本partition 0的leader 为broker 1,会变为broker 2。查看kafka日志,发现了下面的信息,但是没看太明白,网上也没找到解决办法。有没有人遇到过类似的情况?
[2015-09-01 13:45:12,402] WARN [Replica Manager on Broker 24]: Fetch request with correlation id 1553237 from client ReplicaFetcherThread-0-24 on partition [fortest2,7] failed due to Leader not local for partition [fortest2,7] on broker 24 (kafka.server.ReplicaManager)
[2015-09-01 13:45:16,938] WARN [KafkaApi-24] Produce request with correlation id 1843066 from client on partition [fortest2,7] failed due to Leader not local for partition [fortest2,7] on broker 24 (kafka.server.KafkaApis)
[2015-09-01 13:45:12,406] ERROR [ReplicaFetcherThread-0-26], Error for partition [nginxlogtopic,10] to broker 26:class kafka.common.NotLeaderForPartitionException (kafka.server.ReplicaFetcherThread)
[2015-09-01 13:45:12,406] ERROR [ReplicaFetcherThread-0-26], Error for partition [udpToRead,6] to broker 26:class kafka.common.NotLeaderForPartitionException (kafka.server.ReplicaFetcherThread)
[2015-09-01 13:45:16,938] WARN [KafkaApi-24] Produce request with correlation id 1843066 from client on partition [fortest2,15] failed due to Leader not local for partition [fortest2,15] on broker 24 (kafka.server.KafkaApis)
[2015-09-01 13:45:16,941] WARN [KafkaApi-24] Produce request with correlation id 1837853 from client on partition [fortest2,7] failed due to Leader not local for partition [fortest2,7] on broker 24 (kafka.server.KafkaApis)
[2015-09-01 13:45:16,941] WARN [KafkaApi-24] Produce request with correlation id 1837853 from client on partition [fortest2,15] failed due to Leader not local for partition [fortest2,15] on broker 24 (kafka.server.KafkaApis)
[2015-09-01 13:45:16,945] WARN [KafkaApi-24] Produce request with correlation id 1836177 from client on partition [fortest2,7] failed due to Leader not local for partition [fortest2,7] on broker 24 (kafka.server.KafkaApis)
[2015-09-01 13:45:16,945] WARN [KafkaApi-24] Produce request with correlation id 1836177 from client on partition [fortest2,15] failed due to Leader not local for partition [fortest2,15] on broker 24 (kafka.server.KafkaApis)
[2015-09-01 13:45:16,946] WARN [KafkaApi-24] Produce request with correlation id 1840172 from client on partition [fortest2,7] failed due to Leader not local for partition [fortest2,7] on broker 24 (kafka.server.KafkaApis)
[2015-09-01 13:45:16,946] WARN [KafkaApi-24] Produce request with correlation id 1840172 from client on partition [fortest2,15] failed due to Leader not local for partition [fortest2,15] on broker 24 (kafka.server.KafkaApis)
感觉应该是在某个broker down掉后,从分区接手时才应该切换。但是broker并没有down
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
晕倒,我的是broker 宕掉后,重新起来就这样了。大师救救俺吧!
你好,这个问题解决了么?是不是应为依赖的jar的问题?