ERROR Failed to clean up logfor __consumer_offsets-37in 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
启动或运行一段时间后:
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
你看下进程的情况,是否没有真正的杀死之前的进程
解决了吗?我也遇到这个问,每次都是删除log然后重启,过一段时间自动清理日志又报,你们怎么解决的
java.nio.file.AccessDeniedException:D:\tmp\kafak\logs__consumer_00000000.log.cleaned
解决了吗,好像是说windows 才有这个问题?删了重启是可以,但是这样不敢用啊
这个错误是kafka进程占用了文件,又起了新的就会报,之前的没死掉了,文件被占用。
解决了么,麻烦给说下解决方法
你的答案