kafka常见错误

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

原因:

  1. 三台服务器未启动,leader宕机
  2. 三台配置不同,我的错误就是第二台中的分区目录log.dirs=/home/software/kafka_2.10-0.10.0.1/kafka-logs配置不同,没有建立分区文件,导致没有选出leader

你可能感兴趣的:(kafka)