一、启动报错
WARN [AdminClient clientId=adminclient-1] Connection to node -1 (localhost/127.0.0.1:9092) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)
解决:重启kafka
org.apache.kafka.common.KafkaException: Socket server failed to bind to 114.115.20.100:9092: Cannot
解决:在kafka安装目录的conf下,编辑server.properties,添加如下内容
listeners=PLAINTEXT://:9092
advertised.listeners=PLAINTEXT://114.115.20.100:9092
二、使用报错
The Cluster ID h71epGCWSj6mfBVnsRc-fA doesn’t match stored clusterId Some(RqHGN0qGQ-iXs6idJTZ6rg) in meta.properties. The broker is trying to join the wrong cluster. Configured zookeeper.connect may be wrong.
含义:使用zookeeper集群和kafka匹配id的时候没匹配上,导致连接报错
终极解决:删除kafka-logs,删除topic重新启动zk和kafka
org.apache.kafka.common.network.InvalidReceiveException: Invalid receive (size = 1195725856 larger than 104857600)
解决:删除topic
WARN [Producer clientId=console-producer] Got error produce response with correlation id 5 on topic-partition test-2, retrying (2 attempts left). Error: NOT_LEADER_OR_FOLLOWER (org.apache.kafka.clients.producer.internals.Sender)
[2023-01-30 17:47:45,960] WARN [Producer clientId=console-producer] Received invalid metadata error in produce request on partition test-2 due to org.apache.kafka.common.errors.NotLeaderOrFollowerException: For requests intended only for the leader, this error indicates that the broker is not the current leader. For requests intended for any replica, this error indicates that the broker is not a replica of the topic partition… Going to request metadata update now (org.apache.kafka.clients.producer.internals.Sender)
解决:删除kafka-logs删除topic重新启动zk和kafka文章来源:https://www.toymoban.com/news/detail-404382.html
三、kafka消费不到数据
问题:使用命令生产数据,但是消费命令窗口没有数据,如下图:
解决:删除日志,重启kafka
文章来源地址https://www.toymoban.com/news/detail-404382.html
到了这里,关于kafka使用时常见的几个错误汇总的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!