欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

f

程序员文章站 2022-06-05 14:22:32
...

kafka常见错误整理

一、 flume正常运行,但是kafka接受不了消息,flume日志打印如下

2019-01-18 10:13:44,762 (SinkRunner-PollingRunner-DefaultSinkProcessor) [INFO - kafka.utils.Logging$class.info(Logging.scala:68)] Fetching metadata from broker id:0,host:hadoop01,port:9092 with correlation id 9 for 1 topic(s) Set(weblog)
2019-01-18 10:13:44,763 (SinkRunner-PollingRunner-DefaultSinkProcessor) [INFO - kafka.utils.Logging$class.info(Logging.scala:68)] Connected to hadoop01:9092 for producing
2019-01-18 10:13:44,765 (SinkRunner-PollingRunner-DefaultSinkProcessor) [INFO - kafka.utils.Logging$class.info(Logging.scala:68)] Disconnecting from hadoop01:9092
2019-01-18 10:13:44,766 (SinkRunner-PollingRunner-DefaultSinkProcessor) [INFO - kafka.utils.Logging$class.info(Logging.scala:68)] Disconnecting from hadoop01:9092
2019-01-18 10:13:44,769 (SinkRunner-PollingRunner-DefaultSinkProcessor) [INFO - kafka.utils.Logging$class.info(Logging.scala:68)] Connected to hadoop01:9092 for producing
2019-01-18 10:13:44,771 (SinkRunner-PollingRunner-DefaultSinkProcessor) [WARN - kafka.utils.Logging$class.warn(Logging.scala:83)] Produce request with correlation id 11 failed due to [weblog,0]: kafka.common.NotLeaderForPartitionException

根据NotLeaderForPartitionException可以知道是broker中没有leader导致的异常。我是先创了一个weblog的topic,然后宕掉了其中一台,刚好那台主机是leader,所以导致异常。解决办法:删掉weblog节点,去除宕掉的那台。或者重新启动宕掉的那台。

相关标签: kafka解决