解决了吗,好像是说windows 才有这个问题?删了重启是可以,但是这样不敢用啊
你看下进程的情况,是否没有真正的杀死之前的进程
启动或运行一段时间后:
ERROR Failed to clean up log for __consumer_offsets-37 in dir D:\kafka-runtime\kafka-logs due to IOException (kafka.server.LogDirFailureChannel)
java.nio.file.FileSystemException: D:\kafka-runtime\kafka-logs\__consumer_offsets-37\00000000000000000000.log.cleaned -> D:\kafka-runtime\kafka-logs\__consumer_offsets-37\00000000000000000000.log.swap: 另一个程序正在使用此文件,进程无法访问。
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:786)
at org.apache.kafka.common.record.FileRecords.renameTo(FileRecords.java:211)
at kafka.log.LogSegment.changeFileSuffixes(LogSegment.scala:488)
at kafka.log.Log$$anonfun$replaceSegments$1.apply(Log.scala:1802)
at kafka.log.Log$$anonfun$replaceSegments$1.apply(Log.scala:1802)
at scala.collection.immutable.List.foreach(List.scala:392)
at kafka.log.Log.replaceSegments(Log.scala:1802)
at kafka.log.Cleaner.cleanSegments(LogCleaner.scala:533)
at kafka.log.Cleaner$$anonfun$doClean$4.apply(LogCleaner.scala:465)
at kafka.log.Cleaner$$anonfun$doClean$4.apply(LogCleaner.scala:464)
at scala.collection.immutable.List.foreach(List.scala:392)
at kafka.log.Cleaner.doClean(LogCleaner.scala:464)
at kafka.log.Cleaner.clean(LogCleaner.scala:442)
at kafka.log.LogCleaner$CleanerThread.cleanOrSleep(LogCleaner.scala:303)
at kafka.log.LogCleaner$CleanerThread.doWork(LogCleaner.scala:289)
at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:82)
Suppressed: java.nio.file.FileSystemException: D:\kafka-runtime\kafka-logs\__consumer_offsets-37\00000000000000000000.log.cleaned -> D:\kafka-runtime\kafka-logs\__consumer_offsets-37\00000000000000000000.log.swap: 另一个程序正在使用此文件,进程无法访问。
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:783)
... 15 more