开发者社区> 问答> 正文

kafka运行时报错ERROR Failed to clean up log f?400报错

kafka安装在windows下,版本是kafka_2.12-2.0.0.tgz (asc, sha512) ,非常不稳定,运行个一两天,两三天就会报错。错误如下:

[2018-08-12 10:04:52,070] ERROR Failed to clean up log for __consumer_offsets-4 in dir C:\tmp\kafka-logs due to IOException (kafka.server.LogDirFailureChannel)
java.nio.file.FileSystemException: C:\tmp\kafka-logs\__consumer_offsets-4\00000000000000000000.log.cleaned -> C:\tmp\kafka-logs\__consumer_offsets-4\00000000000000000000.log.swap: 另一个程序正在使用此文件,进程无法访问。

	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:697)
	at org.apache.kafka.common.record.FileRecords.renameTo(FileRecords.java:212)
	at kafka.log.LogSegment.changeFileSuffixes(LogSegment.scala:415)
	at kafka.log.Log.replaceSegments(Log.scala:1644)
	at kafka.log.Cleaner.cleanSegments(LogCleaner.scala:535)
	at kafka.log.Cleaner.$anonfun$doClean$6(LogCleaner.scala:462)
	at kafka.log.Cleaner.$anonfun$doClean$6$adapted(LogCleaner.scala:461)
	at scala.collection.immutable.List.foreach(List.scala:389)
	at kafka.log.Cleaner.doClean(LogCleaner.scala:461)
	at kafka.log.Cleaner.clean(LogCleaner.scala:438)
	at kafka.log.LogCleaner$CleanerThread.cleanOrSleep(LogCleaner.scala:305)
	at kafka.log.LogCleaner$CleanerThread.doWork(LogCleaner.scala:291)
	at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:82)
	Suppressed: java.nio.file.FileSystemException: C:\tmp\kafka-logs\__consumer_offsets-4\00000000000000000000.log.cleaned -> C:\tmp\kafka-logs\__consumer_offsets-4\00000000000000000000.log.swap: 另一个程序正在使用此文件,进程无法访问。

		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:694)
		... 12 more

我建立的topic只会用到__consumer_offsets-4,然后他经常会报错,

展开
收起
爱吃鱼的程序员 2020-06-06 15:51:48 2228 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB
                        <p>删除C:\tmp\kafka-logs\这个文件夹就好了</p>
    
    2020-06-06 15:52:07
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Java Spring Boot开发实战系列课程【第16讲】:Spring Boot 2.0 实战Apache Kafka百万级高并发消息中间件与原理解析 立即下载
MaxCompute技术公开课第四季 之 如何将Kafka数据同步至MaxCompute 立即下载
消息队列kafka介绍 立即下载