kafka重啟失敗
阿新 • • 發佈:2022-12-13
一個線上環境,因為修改了zookeeper配置,需要重啟下kafka服務,然而重啟後kafka卻報錯了,下面就讓我們來看看復原場景吧!
結果啟動失敗,報如下錯誤:
[2021-05-25 07:26:14,355] INFO Opening socket connection to server localhost/127.0.0.1:2191. Will not attempt to authenticate using SASL (unknown error) (org.apache.zookeeper.ClientCnxn) [2021-05-25 07:26:14,366] INFO Socket connection established, initiating session, client: /127.0.0.1:46372, server: localhost/127.0.0.1:2191 (org.apache.zookeeper.ClientCnxn) [2021-05-25 07:26:14,459] INFO Session establishment complete on server localhost/127.0.0.1:2191, sessionid = 0x101da8295320007, negotiated timeout = 18000 (org.apache.zookeeper.ClientCnxn) [2021-05-25 07:26:14,464] INFO [ZooKeeperClient Kafka server] Connected. (kafka.zookeeper.ZooKeeperClient) [2021-05-25 07:26:15,254] INFO [feature-zk-node-event-process-thread]: Starting (kafka.server.FinalizedFeatureChangeListener$ChangeNotificationProcessorThread) [2021-05-25 07:26:15,352] INFO Feature ZK node at path: /feature does not exist (kafka.server.FinalizedFeatureChangeListener) [2021-05-25 07:26:15,360] INFO Cleared cache (kafka.server.FinalizedFeatureCache) [2021-05-25 07:26:16,369] INFO Cluster ID = ryDbylR1RSmMpFuE_8T9Cw (kafka.server.KafkaServer) [2021-05-25 07:26:16,561] ERROR Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer) kafka.common.InconsistentClusterIdException: The Cluster ID ryDbylR1RSmMpFuE_8T9Cw doesn't match stored clusterId Some(YEC8BCSgSmGemPNNnYU8WA) 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:218) at kafka.Kafka$.main(Kafka.scala:109) at kafka.Kafka.main(Kafka.scala) [2021-05-25 07:26:16,564] INFO shutting down (kafka.server.KafkaServer) [2021-05-25 07:26:16,569] INFO [feature-zk-node-event-process-thread]: Shutting down (kafka.server.FinalizedFeatureChangeListener$ChangeNotificationProcessorThread) [2021-05-25 07:26:16,570] INFO [feature-zk-node-event-process-thread]: Stopped (kafka.server.FinalizedFeatureChangeListener$ChangeNotificationProcessorThread) [2021-05-25 07:26:16,570] INFO [feature-zk-node-event-process-thread]: Shutdown completed (kafka.server.FinalizedFeatureChangeListener$ChangeNotificationProcessorThread) [2021-05-25 07:26:16,652] INFO [ZooKeeperClient Kafka server] Closing. (kafka.zookeeper.ZooKeeperClient) [2021-05-25 07:26:16,760] INFO Session: 0x101da8295320007 closed (org.apache.zookeeper.ZooKeeper) [2021-05-25 07:26:16,760] INFO EventThread shut down for session: 0x101da8295320007 (org.apache.zookeeper.ClientCnxn) [2021-05-25 07:26:16,764] INFO [ZooKeeperClient Kafka server] Closed. (kafka.zookeeper.ZooKeeperClient) [2021-05-25 07:26:16,853] INFO App info kafka.server for 0 unregistered (org.apache.kafka.common.utils.AppInfoParser) [2021-05-25 07:26:16,854] INFO shut down completed (kafka.server.KafkaServer) [2021-05-25 07:26:16,854] ERROR Exiting Kafka. (kafka.Kafka$) [2021-05-25 07:26:16,856] INFO shutting down (kafka.server.KafkaServer)
抓重點,根據上述報錯資訊,可以看到關鍵點 :The Cluster ID ryDbylR1RSmMpFuE_8T9Cw doesn't match stored clusterId Some(YEC8BCSgSmGemPNNnYU8WA) in meta.properties. 大意是群集 ID 與 meta.properties檔案中儲存的clusterID 不匹配。
解決:
在自己的 log.dir路徑下找到配置檔案meta.properties,將cluster.id按照它的提示修改。必如我就將原本的cluster.id=YEC8BCSgSmGemPNNnYU8WA 改為cluster.id=ryDbylR1RSmMpFuE_8T9Cw即可,再來重啟就正常了。
>>>