返回到文章

采纳

kafka启动不起来场景  启动zookeeper,启动kafka  启动生产者发消息,关闭afka  关闭生产者,再次启动报错

kafka

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)