[kafka_2.9.2-0.8.1]$ ./bin/kafka-topics.sh --zookeeper <zookeeper_ensemble> --describe --topic test-1
Topic:test-1 PartitionCount:1 ReplicationFactor:3 Configs:
Topic: test-1 Partition: 0 **Leader: none** Replicas: 0,1,2 **Isr:**
我试图使用控制台生成器写入主题,但遇到LeaderNotAvailableException异常:
[kafka_2.9.2-0.8.1]$ ./kafka-console-producer.sh --broker-list <broker_list> --topic test-1
hello world
[2014-04-22 11:58:48,297] WARN Error while fetching metadata [{TopicMetadata for topic test-1 ->
No partition metadata for topic test-1 due to kafka.common.LeaderNotAvailableException}] for topic [test-1]: class kafka.common.LeaderNotAvailableException (kafka.producer.BrokerPartitionInfo)
[2014-04-22 11:58:48,321] WARN Error while fetching metadata [{TopicMetadata for topic test-1 ->
No partition metadata for topic test-1 due to kafka.common.LeaderNotAvailableException}] for topic [test-1]: class kafka.common.LeaderNotAvailableException (kafka.producer.BrokerPartitionInfo)
[2014-04-22 11:58:48,322] ERROR Failed to collate messages by topic, partition due to: Failed to fetch topic metadata for topic: test-1 (kafka.producer.async.DefaultEventHandler)
[2014-04-22 11:58:48,445] WARN Error while fetching metadata [{TopicMetadata for topic test-1 ->
No partition metadata for topic test-1 due to kafka.common.LeaderNotAvailableException}] for topic [test-1]: class kafka.common.LeaderNotAvailableException (kafka.producer.BrokerPartitionInfo)
[2014-04-22 11:58:48,467] WARN Error while fetching metadata [{TopicMetadata for topic test-1 ->
No partition metadata for topic test-1 due to kafka.common.LeaderNotAvailableException}] for topic [test-1]: class kafka.common.LeaderNotAvailableException (kafka.producer.BrokerPartitionInfo)
[2014-04-22 11:58:48,467] ERROR Failed to collate messages by topic, partition due to: Failed to fetch topic metadata for topic: test-1 (kafka.producer.async.DefaultEventHandler)
[2014-04-22 11:58:48,590] WARN Error while fetching metadata [{TopicMetadata for topic test-1 ->
No partition metadata for topic test-1 due to kafka.common.LeaderNotAvailableException}] for topic [test-1]: class kafka.common.LeaderNotAvailableException (kafka.producer.BrokerPartitionInfo)
[2014-04-22 11:58:48,612] WARN Error while fetching metadata [{TopicMetadata for topic test-1 ->
No partition metadata for topic test-1 due to kafka.common.LeaderNotAvailableException}] for topic [test-1]: class kafka.common.LeaderNotAvailableException (kafka.producer.BrokerPartitionInfo)
[2014-04-22 11:58:48,612] ERROR Failed to collate messages by topic, partition due to: Failed to fetch topic metadata for topic: test-1 (kafka.producer.async.DefaultEventHandler)
[2014-04-22 11:58:48,731] WARN Error while fetching metadata [{TopicMetadata for topic test-1 ->
No partition metadata for topic test-1 due to kafka.common.LeaderNotAvailableException}] for topic [test-1]: class kafka.common.LeaderNotAvailableException (kafka.producer.BrokerPartitionInfo)
[2014-04-22 11:58:48,753] WARN Error while fetching metadata [{TopicMetadata for topic test-1 ->
No partition metadata for topic test-1 due to kafka.common.LeaderNotAvailableException}] for topic [test-1]: class kafka.common.LeaderNotAvailableException (kafka.producer.BrokerPartitionInfo)
[2014-04-22 11:58:48,754] ERROR Failed to collate messages by topic, partition due to: Failed to fetch topic metadata for topic: test-1 (kafka.producer.async.DefaultEventHandler)
[2014-04-22 11:58:48,876] WARN Error while fetching metadata [{TopicMetadata for topic test-1 ->
No partition metadata for topic test-1 due to kafka.common.LeaderNotAvailableException}] for topic [test-1]: class kafka.common.LeaderNotAvailableException (kafka.producer.BrokerPartitionInfo)
[2014-04-22 11:58:48,877] ERROR Failed to send requests for topics test-1 with correlation ids in [0,8] (kafka.producer.async.DefaultEventHandler)
[2014-04-22 11:58:48,878] ERROR Error in handling batch of 1 events (kafka.producer.async.ProducerSendThread)
kafka.common.FailedToSendMessageException: Failed to send messages after 3 tries.
at kafka.producer.async.DefaultEventHandler.handle(DefaultEventHandler.scala:90)
at kafka.producer.async.ProducerSendThread.tryToHandle(ProducerSendThread.scala:104)
at kafka.producer.async.ProducerSendThread$$anonfun$processEvents$3.apply(ProducerSendThread.scala:87)
at kafka.producer.async.ProducerSendThread$$anonfun$processEvents$3.apply(ProducerSendThread.scala:67)
at scala.collection.immutable.Stream.foreach(Stream.scala:547)
at kafka.producer.async.ProducerSendThread.processEvents(ProducerSendThread.scala:66)
at kafka.producer.async.ProducerSendThread.run(ProducerSendThread.scala:44)
我还应该指出,这在最初的几天内是有效的,然后突然间,任何一个被创建的主题都有这个缺少领导者的问题。
Kafka使用外部协调框架(默认为Zookeeper)来维护配置。现在的配置似乎与Kafka日志数据不同步。在这种情况下,我会删除受影响的主题数据和相关的Zookeeper数据。
对于测试环境:
kafka-server
和zookeeper-server
/tmp/kafka-log
和/tmp/zookeeper
。kafka-server
和zookeeper-server
现在你可以再一次使用这个主题了。
对于生产环境:
由于Kafaka主题存储在不同的目录中,您应该删除特定的目录。还应该使用Zookeeper客户端从Zookeeper中删除/brokers/{broker_id}/topics/{broken_topic}
。
问题内容: 这不是让我输入我的名字,但是年龄确实可以。我知道我可以更改语句的顺序,但是还有另一种方法可以做到吗? 问题答案: 您的问题是,下一个int不考虑输入在您的姓名部分中的换行符。因此,名称返回为空白。 您可以通过两种方式更改代码: 要么 我个人喜欢第二种方式。
问题内容: 使用pip在Windows 10上的命令行中安装TextBlob时遇到一些困难。 根据他们的文档,您需要连续运行两个命令: 尝试第一个命令时,出现错误,在尝试安装软件包时从未见过: 我不是Windows 10专家,我真的不知道这是怎么回事-有人可以指出正确的方向吗? 谢谢! 问题答案: 最新版本的pip错误。如果您最近更新了pip并遇到此问题,这是对我有用的(基于https://git
当我使用inspector工具时,它表示元素是一个输入框。我不知道如何解决这个问题,因为我对python非常缺乏经验 输出是一个空字符串,尽管网站显示了一封电子邮件供我使用。
我在尝试使用iText编辑pdf文档时遇到以下异常。这个问题是非常零星的,就像有时它是工作的,有时它是抛出错误。 下面是我用来编辑的代码:
问题内容: 我正在使用python-dateutil从字符串中解析日期: 我期望的是引发异常,但它返回的是当前日期。如果在提供的字符串中找不到日期,有人可以告诉我如何避免获取当前日期吗? 提前致谢。 问题答案: 请参阅dateutil文档,特别是解析函数(强调我的): 此外,可以使用以下关键字参数: 默认值 如果给出,则它必须是日期时间实例。解析日期中缺少的任何字段都将从该实例复制。 默认值为当前
我使用以下方式安装Gatsbyjs: 它安装,然后当我试图创建一个新的网站,它显示一些错误。 我尝试了盖茨比新网站,但它显示了一些错误: PS C:\Users\Klawnny\Dropbox\react电子商务 gatsby-cli@2.7.53更新了一个包在46.004s PS C:\用户\克劳尼\Dropbox\电子商务与反应 文件C:\Users\Klawnny\AppData\Roami