回顾:
Windows Kafka 错误如下:
[2021-07-06 09:05:54,809] ERROR Failed to clean up log for __consumer_offsets-42 in dir C:\tmp\kafka-logs due to IOException (kafka.server.LogDirFailureChannel)
java.nio.file.FileSystemException: C:\tmp\kafka-logs\__consumer_offsets-42\00000000000000000000.timeindex.cleaned -> C:\tmp\kafka-logs\__consumer_offsets-42\00000000000000000000.timeindex.swap:
[2021-07-06 09:06:06,460] ERROR [Log partition=__consumer_offsets-42, dir=C:\tmp\kafka-logs] Could not find offset index file corresponding to log file C:\tmp\kafka-logs\__consumer_offsets-42\00000000000000000000.log, recovering segment and rebuilding index files... (kafka.log.Log)
[2021-07-06 09:06:10,607] ERROR Error while creating ephemeral at /brokers/ids/0, node already exists and owner '72057597827809280' does not match current session '72057597827809313' (kafka.zk.KafkaZkClient$CheckedEphemeral)
[2021-07-06 09:06:10,616] ERROR [KafkaServer id=0] Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists
at org.apache.zookeeper.KeeperException.create(KeeperException.java:126)
at kafka.zk.KafkaZkClient$CheckedEphemeral.getAfterNodeExists(KafkaZkClient.scala:1904)
at kafka.zk.KafkaZkClient$CheckedEphemeral.create(KafkaZkClient.scala:1842)
at kafka.zk.KafkaZkClient.checkedEphemeralCreate(KafkaZkClient.scala:1809)
at kafka.zk.KafkaZkClient.registerBroker(KafkaZkClient.scala:96)
at kafka.server.KafkaServer.startup(KafkaServer.scala:308)
at kafka.Kafka$.main(Kafka.scala:109)
at kafka.Kafka.main(Kafka.scala)
临时解决方案
停止 zookeeper 和 Kafka ,删除 C:\tmp\kafka-logs\__consumer_offsets-42\ 文件夹下面的所有文件。
|