文章目录
一、启动报错
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
三、kafka消费不到数据
问题:使用命令生产数据,但是消费命令窗口没有数据,如下图:
解决:删除日志,重启kafka
版权归原作者 菠菜很好吃 所有, 如有侵权,请联系我们删除。