kafka启动不起来场景 启动zookeeper,启动kafka 启动生产者发消息,关闭afka 关闭生产者,再次启动报错
INFO Loading logs. (kafka.log.LogManager)
[2017-09-06 15:34:58,459] WARN Found a corrupted index file due to requirement failed: Corrupt index found, index file (D:\soft\kafka_2.11-0.11.0.0\logs\test-0\00000000000000000000.index) has non-zero size but the last offset is 0 which is no larger than the base offset 0.}. deleting D:\soft\kafka_2.11-0.11.0.0\logs\test-0\00000000000000000000.timeindex, D:\soft\kafka_2.11-0.11.0.0\logs\test-0\00000000000000000000.index, and D:\soft\kafka_2.11-0.11.0.0\logs\test-0\00000000000000000000.txnindex and rebuilding index... (kafka.log.Log)
[2017-09-06 15:34:58,461] ERROR There was an error in one of the threads during logs loading: java.nio.file.FileSystemException: D:\soft\kafka_2.11-0.11.0.0\logs\test-0\00000000000000000000.timeindex: 另一个程序正在使用此文件,进程无法访问 。
(kafka.log.LogManager)
[2017-09-06 15:34:58,463] FATAL [Kafka Server 0], Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
java.nio.file.FileSystemException: D:\soft\kafka_2.11-0.11.0.0\logs\test-0\00000000000000000000.timeindex: 另一个程序正 在使用此文件,进程无法访问。
at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:269)
at sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:108)
at java.nio.file.Files.deleteIfExists(Files.java:1165)
at kafka.log.Log$$anonfun$loadSegmentFiles$3.apply(Log.scala:311)
at kafka.log.Log$$anonfun$loadSegmentFiles$3.apply(Log.scala:272)
at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:733)
at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186)
at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:732)
at kafka.log.Log.loadSegmentFiles(Log.scala:272)
at kafka.log.Log.loadSegments(Log.scala:376)
at kafka.log.Log.<init>(Log.scala:179)
at kafka.log.Log$.apply(Log.scala:1580)
at kafka.log.LogManager$$anonfun$loadLogs$2$$anonfun$5$$anonfun$apply$12$$anonfun$apply$1.apply$mcV$sp(LogManager.scala:172)
at kafka.utils.CoreUtils$$anon$1.run(CoreUtils.scala:57)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
[2017-09-06 15:34:58,470] INFO [Kafka Server 0], shutting down (kafka.server.KafkaServer)
[2017-09-06 15:34:58,474] INFO Terminate ZkClient event thread. (org.I0Itec.zkclient.ZkEventThread)
[2017-09-06 15:34:58,499] INFO Session: 0x15e5613d5770002 closed (org.apache.zookeeper.ZooKeeper)
[2017-09-06 15:34:58,502] INFO EventThread shut down for session: 0x15e5613d5770002 (org.apache.zookeeper.ClientCnxn)
[2017-09-06 15:34:58,508] INFO [Kafka Server 0], shut down completed (kafka.server.KafkaServer)
[2017-09-06 15:34:58,509] FATAL Exiting Kafka. (kafka.server.KafkaServerStartable)
[2017-09-06 15:34:58,514] INFO [Kafka Server 0], shutting down (kafka.server.KafkaServer)
我在windows上也遇到这个问题了,目前是0.11.0.x有这个问题.
问题定位到了吗?
我也是0.11.0版本,电脑重启也没用,只能每次删日志才能起起来
看来遇到这个错的人挺多的。。
https://issues.apache.org/jira/browse/KAFKA-1194 这个有说明
这是没关成功吧。。
我也遇到了同样的问题,求大神帮解答。
昨天启动kafka 后 ,生产者与消费者通信成功,今天再来试,再次启动也报文件被占用
网上说的删日志之类的试了,还是不行
自己来跟个吧,免得有人同样的问题
1.全磁盘搜索了自己创建的topic名字,找到了D:\Program Fileskafka_2.11-0.11.0.1kafka_2.11-0.11.0.1kafka-logs\linlin-0
2.把linlin文件夹里的东西全部删除(linlin为topic名称)
这个目录不应该是你在server.conf里面配置的么。。
被占用 说明之前的进程还在,没有kill死吧。
兄弟,这样你解决了么?我好像还是会遇到问题,跟你一样照着csdn那个人的做的
怎么kill死??求个代码 昨天刚学头都大了
ps -ef|grep Kafka|awk '{print $2}'|xargs kill -9
在哪个位置运行?另外我这个报错您能帮我看看么
跟上面报的一样额,我是没遇到过,你可以先确定是否真正的把之前的服务给关闭了。
怎么真正把之前的服务给关闭
手动删除这个文件。
E:\WorkSoftware\kafka_2.11-1.0.0\logs\test.topic-0\00000000000000000000.timeindex
和开发确认 遗留的消息还需不需要,如果不需要,直接修改kafka-server的配置文件,重启即可
原因是删了kafka-logs下的日志,导致启动recover时无法找到恢复日志点。
你的答案