当前位置:   article > 正文

Kafka KRaft 模式在Windows上报错 FileSystemException:另一个程序正在使用此文件,进程无法访问。_java.nio.file.filesystemexception: d:\test.doc: 另一

java.nio.file.filesystemexception: d:\test.doc: 另一个程序正在使用此文件,进

报错信息

[2024-01-02 16:44:00,892] INFO [raft-expiration-reaper]: Starting (kafka.raft.TimingWheelExpirationService$ExpiredOperationReaper)
[2024-01-02 16:44:01,041] ERROR Exiting Kafka due to fatal exception (kafka.Kafka$)
java.io.UncheckedIOException: Error while writing the Quorum status from the file D:\dev\kafka_2.13-3.3.1\logs\kraft-combined-logs\__cluster_metadata-0\quorum-state
        at org.apache.kafka.raft.FileBasedStateStore.writeElectionStateToFile(FileBasedStateStore.java:155)
        at org.apache.kafka.raft.FileBasedStateStore.writeElectionState(FileBasedStateStore.java:128)
        at org.apache.kafka.raft.QuorumState.transitionTo(QuorumState.java:477)
        at org.apache.kafka.raft.QuorumState.initialize(QuorumState.java:212)
        at org.apache.kafka.raft.KafkaRaftClient.initialize(KafkaRaftClient.java:369)
        at kafka.raft.KafkaRaftManager.buildRaftClient(RaftManager.scala:200)
        at kafka.raft.KafkaRaftManager.<init>(RaftManager.scala:127)
        at kafka.server.KafkaRaftServer.<init>(KafkaRaftServer.scala:83)
        at kafka.Kafka$.buildServer(Kafka.scala:79)
        at kafka.Kafka$.main(Kafka.scala:87)
        at kafka.Kafka.main(Kafka.scala)
Caused by: java.nio.file.FileSystemException: D:\dev\kafka_2.13-3.3.1\logs\kraft-combined-logs\__cluster_metadata-0\quorum-state.tmp -> D:\dev\kafka_2.13-3.3.1\logs\kraft-combined-logs\__cluster_metadata-0\quorum-state: 另一个程序正在使 用此文件,进程无法访问。

        at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
        at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
        at sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:387)
        at sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:287)
        at java.nio.file.Files.move(Files.java:1395)
        at org.apache.kafka.common.utils.Utils.atomicMoveWithFallback(Utils.java:935)
        at org.apache.kafka.common.utils.Utils.atomicMoveWithFallback(Utils.java:918)
        at org.apache.kafka.raft.FileBasedStateStore.writeElectionStateToFile(FileBasedStateStore.java:152)
        ... 10 more
        Suppressed: java.nio.file.FileSystemException: D:\dev\kafka_2.13-3.3.1\logs\kraft-combined-logs\__cluster_metadata-0\quorum-state.tmp -> D:\dev\kafka_2.13-3.3.1\logs\kraft-combined-logs\__cluster_metadata-0\quorum-state: 另一个程序正在使用此文件,进程无法访问。

                at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
                at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
                at sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:301)
                at sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:287)
                at java.nio.file.Files.move(Files.java:1395)
                at org.apache.kafka.common.utils.Utils.atomicMoveWithFallback(Utils.java:932)
                ... 12 more

解决办法: 升级到 3.6.0

相关issue参考:  [KAFKA-14273] Kafka doesn't start with KRaft on Windows - ASF JIRA

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/不正经/article/detail/131379
推荐阅读
相关标签
  

闽ICP备14008679号