首页 > 代码库 > IllegalArgumentException: requirement failed: Corrupt index found
IllegalArgumentException: requirement failed: Corrupt index found
今天突然接到客户反映线上服务器发送消息异常,登录服务器查看是kafka服务出现了问题,想重启一下服务,结果重启出现一下报错
[2017-06-30 19:29:13,708] FATAL Fatal error during KafkaServerStartable startup. Prepare to shutdown (kafka.server.KafkaServerStartable)
java.lang.IllegalArgumentException: requirement failed: Corrupt index found, index file (/data/apps/log/kafka/metrics-topic-13/00000000000000000000.index) has non-zero size but the last offset is 0 and the base offset is 0
at scala.Predef$.require(Predef.scala:219)
at kafka.log.OffsetIndex.sanityCheck(OffsetIndex.scala:352)
at kafka.log.Log$$anonfun$loadSegments$5.apply(Log.scala:184)
at kafka.log.Log$$anonfun$loadSegments$5.apply(Log.scala:183)
at scala.collection.Iterator$class.foreach(Iterator.scala:750)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1202)
at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
at kafka.log.Log.loadSegments(Log.scala:183)
at kafka.log.Log.<init>(Log.scala:67)
at kafka.log.LogManager$$anonfun$loadLogs$2$$anonfun$3$$anonfun$apply$7$$anonfun$apply$1.apply$mcV$sp(LogManager.scala:142)
at kafka.utils.Utils$$anon$1.run(Utils.scala:54)
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:745)
[2017-06-30 19:29:13,711] INFO [Kafka Server 2], shutting down (kafka.server.KafkaServer)
解决方法如下:
find kafka-logs/ -size 10485760c -name *.index
将以上命令中搜索到的所有文件删除,在重启kafka,kafka会重新生成相应的文件,询问研发人员说删除的数据不会对线上服务造成影响,但是如果你也碰到了这种问题最好还是要先问问你们部门的研发人员,在做相关的操作
IllegalArgumentException: requirement failed: Corrupt index found
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。