window部署单机kafka和zookeeper,运行一段时间后,自动挂掉,提示错误信息。
尝试修改配置的分区数,修改文件夹权限,重新启动能运行一段时间,但是都会崩掉。
错误信息如下:
[2021-09-23 15:37:12,490] ERROR [ReplicaManager broker=0] Error while writing to highwatermark file in directory C:\kafka\kafka\kafka_2.12-2.3.0-SNAPSHOT\.\klog (kafka.server.ReplicaManager)
org.apache.kafka.common.errors.KafkaStorageException: Error while writing to checkpoint file C:\kafka\kafka\kafka_2.12-2.3.0-SNAPSHOT\.\klog\replication-offset-checkpoint
Caused by: java.nio.file.FileAlreadyExistsException: C:\kafka\kafka\kafka_2.12-2.3.0-SNAPSHOT\.\klog\replication-offset-checkpoint.tmp -> C:\kafka\kafka\kafka_2.12-2.3.0-SNAPSHOT\.\klog\replication-offset-checkpoint
at sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at sun.nio.fs.WindowsFileCopy.move(Unknown Source)
at sun.nio.fs.WindowsFileSystemProvider.move(Unknown Source)
at java.nio.file.Files.move(Unknown Source)
at org.apache.kafka.common.utils.Utils.atomicMoveWithFallback(Utils.java:815)
at kafka.server.checkpoints.CheckpointFile.liftedTree1$1(CheckpointFile.scala:72)
at kafka.server.checkpoints.CheckpointFile.write(CheckpointFile.scala:50)
at kafka.server.checkpoints.OffsetCheckpointFile.write(OffsetCheckpointFile.scala:59)
at kafka.server.ReplicaManager.$anonfun$checkpointHighWatermarks$9(ReplicaManager.scala:1428)
at kafka.server.ReplicaManager.$anonfun$checkpointHighWatermarks$9$adapted(ReplicaManager.scala:1428)
at scala.Option.foreach(Option.scala:274)
at kafka.server.ReplicaManager.$anonfun$checkpointHighWatermarks$7(ReplicaManager.scala:1428)
at kafka.server.ReplicaManager.$anonfun$checkpointHighWatermarks$7$adapted(ReplicaManager.scala:1425)
at scala.collection.TraversableLike$WithFilter.$anonfun$foreach$1(TraversableLike.scala:792)
at scala.collection.immutable.Map$Map1.foreach(Map.scala:128)
at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:791)
at kafka.server.ReplicaManager.checkpointHighWatermarks(ReplicaManager.scala:1425)
at kafka.server.ReplicaManager.$anonfun$startHighWaterMarksCheckPointThread$1(ReplicaManager.scala:259)
at kafka.utils.KafkaScheduler.$anonfun$schedule$2(KafkaScheduler.scala:114)
at kafka.utils.CoreUtils$$anon$1.run(CoreUtils.scala:65)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Suppressed: java.nio.file.AccessDeniedException: C:\kafka\kafka\kafka_2.12-2.3.0-SNAPSHOT\.\klog\replication-offset-checkpoint.tmp -> C:\kafka\kafka\kafka_2.12-2.3.0-SNAPSHOT\.\klog\replication-offset-checkpoint
at sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at sun.nio.fs.WindowsFileCopy.move(Unknown Source)
at sun.nio.fs.WindowsFileSystemProvider.move(Unknown Source)
at java.nio.file.Files.move(Unknown Source)
at org.apache.kafka.common.utils.Utils.atomicMoveWithFallback(Utils.java:812)
... 22 more
刚才检索了一下,这个是windows系统的一个bug,需要升级:
我不太确定你的系统版本和kafka的版本,你可以参考一下相关链接:
https://community.microstrategy.com/s/article/Windows-Kafka-could-not-be-started-due-to-file-system-errors-in-MicroStrategy-2019-Update-2-and-up?language=en_US
https://www.ibm.com/support/pages/apar/JR60532
https://www.ibm.com/support/pages/node/878310
大哥,这个问题最终时怎么解决的?
你的答案