Kafka 消费者无法找到 Set 和 Fetching 主题元数据的领导者,相关 ID 为 4 的主题失败
Kafka consumer Failed to find leader for Set and Fetching topic metadata with correlation id 4 for topics failed
所以我在 mesos 中使用单个 kafka 0.8.2.0 代理和 java 消费者 运行ning 时遇到此错误。我不得不说它曾经有效,而且 AFAIK 没有任何改变。
mesos 中消费者 运行 时的错误如下:
16/03/17 05:44:23 WARN ConsumerFetcherManager$LeaderFinderThread: [alertConsumer_secasprddb01-1-1458193432645-387abff0-leader-finder-thread], Failed to find leader for Set([events,1], [events,14], [events,2], [events,8], [events,7], [events,10], [events,3], [events,11], [events,5], [events,0], [events,12], [events,13], [events,6], [events,4], [events,9]) kafka.common.KafkaException: fetching topic metadata for topics [Set(events)] from broker [ArrayBuffer(id:0,host:prodMessage01-1.blah.com,port:9092)] failed at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:72)
at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:93)
at kafka.consumer.ConsumerFetcherManager$LeaderFinderThread.doWork(ConsumerFetcherManager.scala:66)
at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:60) Caused by: java.net.SocketTimeoutException
我什至完全删除了主题并从头开始重新创建它,仍然是同样的错误。
如果我 运行 脚本 kafka-console-consumer.sh 在与代理相同的盒子上,我仍然收到错误:
Failed to find leader for Set([events,1], [events,14], [events,2], [events,8], [events,7], [events,10], [events,3], [events,11], [events,5], [events,0], [events,12], [events,13], [events,6], [events,9], [events,4]) (kafka.consumer.ConsumerFetcherManager$LeaderFinderThread) kafka.common.KafkaException: fetching topic metadata for topics [Set(events)] from broker [ArrayBuffer(id:0,host:prodMessage01-1.blah.com,port:9092)] failed
at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:72)
at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:93)
at kafka.consumer.ConsumerFetcherManager$LeaderFinderThread.doWork(ConsumerFetcherManager.scala:66)
at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:60) Caused by: java.net.SocketTimeoutException
所以即使一切都在代理本地,它仍然会失败。这怎么可能?
如果我真的删除并重新创建了主题,我不知道如何解决这个问题。
如果我做一个主题描述(kafka-topics.sh -- 描述),它工作正常:
Topic:events PartitionCount:15 ReplicationFactor:1 Configs:
Topic: events Partition: 0 Leader: 0 Replicas: 0 Isr: 0
Topic: events Partition: 1 Leader: 0 Replicas: 0 Isr: 0
Topic: events Partition: 2 Leader: 0 Replicas: 0 Isr: 0
Topic: events Partition: 3 Leader: 0 Replicas: 0 Isr: 0
Topic: events Partition: 4 Leader: 0 Replicas: 0 Isr: 0
Topic: events Partition: 5 Leader: 0 Replicas: 0 Isr: 0
Topic: events Partition: 6 Leader: 0 Replicas: 0 Isr: 0
Topic: events Partition: 7 Leader: 0 Replicas: 0 Isr: 0
Topic: events Partition: 8 Leader: 0 Replicas: 0 Isr: 0
Topic: events Partition: 9 Leader: 0 Replicas: 0 Isr: 0
Topic: events Partition: 10 Leader: 0 Replicas: 0 Isr: 0
Topic: events Partition: 11 Leader: 0 Replicas: 0 Isr: 0
Topic: events Partition: 12 Leader: 0 Replicas: 0 Isr: 0
Topic: events Partition: 13 Leader: 0 Replicas: 0 Isr: 0
Topic: events Partition: 14 Leader: 0 Replicas: 0 Isr: 0
请参阅上面关于我如何解决问题的评论。但它不适合生产环境。
所以我在 mesos 中使用单个 kafka 0.8.2.0 代理和 java 消费者 运行ning 时遇到此错误。我不得不说它曾经有效,而且 AFAIK 没有任何改变。
mesos 中消费者 运行 时的错误如下:
16/03/17 05:44:23 WARN ConsumerFetcherManager$LeaderFinderThread: [alertConsumer_secasprddb01-1-1458193432645-387abff0-leader-finder-thread], Failed to find leader for Set([events,1], [events,14], [events,2], [events,8], [events,7], [events,10], [events,3], [events,11], [events,5], [events,0], [events,12], [events,13], [events,6], [events,4], [events,9]) kafka.common.KafkaException: fetching topic metadata for topics [Set(events)] from broker [ArrayBuffer(id:0,host:prodMessage01-1.blah.com,port:9092)] failed at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:72)
at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:93)
at kafka.consumer.ConsumerFetcherManager$LeaderFinderThread.doWork(ConsumerFetcherManager.scala:66)
at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:60) Caused by: java.net.SocketTimeoutException
我什至完全删除了主题并从头开始重新创建它,仍然是同样的错误。
如果我 运行 脚本 kafka-console-consumer.sh 在与代理相同的盒子上,我仍然收到错误:
Failed to find leader for Set([events,1], [events,14], [events,2], [events,8], [events,7], [events,10], [events,3], [events,11], [events,5], [events,0], [events,12], [events,13], [events,6], [events,9], [events,4]) (kafka.consumer.ConsumerFetcherManager$LeaderFinderThread) kafka.common.KafkaException: fetching topic metadata for topics [Set(events)] from broker [ArrayBuffer(id:0,host:prodMessage01-1.blah.com,port:9092)] failed
at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:72)
at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:93)
at kafka.consumer.ConsumerFetcherManager$LeaderFinderThread.doWork(ConsumerFetcherManager.scala:66)
at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:60) Caused by: java.net.SocketTimeoutException
所以即使一切都在代理本地,它仍然会失败。这怎么可能?
如果我真的删除并重新创建了主题,我不知道如何解决这个问题。
如果我做一个主题描述(kafka-topics.sh -- 描述),它工作正常:
Topic:events PartitionCount:15 ReplicationFactor:1 Configs:
Topic: events Partition: 0 Leader: 0 Replicas: 0 Isr: 0
Topic: events Partition: 1 Leader: 0 Replicas: 0 Isr: 0
Topic: events Partition: 2 Leader: 0 Replicas: 0 Isr: 0
Topic: events Partition: 3 Leader: 0 Replicas: 0 Isr: 0
Topic: events Partition: 4 Leader: 0 Replicas: 0 Isr: 0
Topic: events Partition: 5 Leader: 0 Replicas: 0 Isr: 0
Topic: events Partition: 6 Leader: 0 Replicas: 0 Isr: 0
Topic: events Partition: 7 Leader: 0 Replicas: 0 Isr: 0
Topic: events Partition: 8 Leader: 0 Replicas: 0 Isr: 0
Topic: events Partition: 9 Leader: 0 Replicas: 0 Isr: 0
Topic: events Partition: 10 Leader: 0 Replicas: 0 Isr: 0
Topic: events Partition: 11 Leader: 0 Replicas: 0 Isr: 0
Topic: events Partition: 12 Leader: 0 Replicas: 0 Isr: 0
Topic: events Partition: 13 Leader: 0 Replicas: 0 Isr: 0
Topic: events Partition: 14 Leader: 0 Replicas: 0 Isr: 0
请参阅上面关于我如何解决问题的评论。但它不适合生产环境。