欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 新闻 > 会展 > 连接kafka消息队列报org.apache.kafka.clients.NetworkClient异常

连接kafka消息队列报org.apache.kafka.clients.NetworkClient异常

2024/11/13 14:55:09 来源:https://blog.csdn.net/vinegar93/article/details/143585203  浏览:    关键词:连接kafka消息队列报org.apache.kafka.clients.NetworkClient异常

启动kafka后,连接kafka消息队列报org.apache.kafka.clients.NetworkClient异常

could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)

检查kafka运行日志,报The broker is trying to join the wrong cluster异常

[2024-11-06 16:31:11,219] ERROR Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
kafka.common.InconsistentClusterIdException: The Cluster ID QAy4XKSVSYWyIWRKCl3BBQ doesn't match stored clusterId Some(AMdXxjsGTe-ebuBwX0E57g) in meta.properties. The broker is trying to join the wrong cluster. Configured zookeeper.connect may be wrong.at kafka.server.KafkaServer.startup(KafkaServer.scala:252)at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:44)at kafka.Kafka$.main(Kafka.scala:82)at kafka.Kafka.main(Kafka.scala)
[2024-11-06 16:31:11,221] INFO shutting down (kafka.server.KafkaServer)
[2024-11-06 16:31:11,223] INFO [feature-zk-node-event-process-thread]: Shutting down (kafka.server.FinalizedFeatureChangeListener$ChangeNotificationProcessorThread)
[2024-11-06 16:31:11,224] INFO [feature-zk-node-event-process-thread]: Shutdown completed (kafka.server.FinalizedFeatureChangeListener$ChangeNotificationProcessorThread)
[2024-11-06 16:31:11,224] INFO [feature-zk-node-event-process-thread]: Stopped (kafka.server.FinalizedFeatureChangeListener$ChangeNotificationProcessorThread)
[2024-11-06 16:31:11,225] INFO [ZooKeeperClient Kafka server] Closing. (kafka.zookeeper.ZooKeeperClient)
[2024-11-06 16:31:11,329] INFO Session: 0x110085d708f0001 closed (org.apache.zookeeper.ZooKeeper)
[2024-11-06 16:31:11,329] INFO EventThread shut down for session: 0x110085d708f0001 (org.apache.zookeeper.ClientCnxn)
[2024-11-06 16:31:11,331] INFO [ZooKeeperClient Kafka server] Closed. (kafka.zookeeper.ZooKeeperClient)
[2024-11-06 16:31:11,335] INFO App info kafka.server for 0 unregistered (org.apache.kafka.common.utils.AppInfoParser)
[2024-11-06 16:31:11,336] INFO shut down completed (kafka.server.KafkaServer)
[2024-11-06 16:31:11,337] ERROR Exiting Kafka. (kafka.server.KafkaServerStartable)
[2024-11-06 16:31:11,337] INFO shutting down (kafka.server.KafkaServer)

修改kafka日志目录的meta.properties文件的cluster.id值

cluster.id=AMdXxjsGTe-ebuBwX0E57g
version=0
broker.id=0

最后再重启kafka,连接恢复正常

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com