kafka错误
在我尝试用 一台虚拟机创建一个topic,然后开启生产者出现如下错误:
ERROR Error when sending message to topic recommender3 with key: null, value: 3 bytes with error:(org.apache.kafka.clients.producer.internals.ErrorLoggingCallback) org.apache.kafka.common.errors.NotLeaderForPartitionException: This server is not the leader for that topic-partition
在网上找了许多的资料,都说 Leader出问题,很多方法都试了,不能解决 ,我有仔细看了一下log.dirs(在config/service.properties)下的日志,发现问题所在 。
解决方案:删除所有log文件夹(查看config/server.properties中的log.dirs配置路径)下的replication-offset-checkpoint和recovery-point-offset-checkpoint这两个文件即可。## kafka常见错误