kafka分区leader切换

heistt 发布于 2015/09/01 16:58
阅读 10K+
收藏 0

Serverless 架构就不要服务器了?>>>

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


加载中
0
l
lw186019
你好,这个问题解决了么?是不是应为依赖的jar的问题?
0
u
uplinker
晕倒,我的是broker 宕掉后,重新起来就这样了。大师救救俺吧!
返回顶部
顶部