码迷,mamicode.com
首页 > 其他好文 > 详细

IllegalArgumentException: requirement failed: Corrupt index found

时间:2017-07-01 00:06:46      阅读:386      评论:0      收藏:0      [点我收藏+]

标签:class   err   查看   iterator   exce   work   dap   pps   发送消息   

今天突然接到客户反映线上服务器发送消息异常,登录服务器查看是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

标签:class   err   查看   iterator   exce   work   dap   pps   发送消息   

原文地址:http://www.cnblogs.com/Cherry-Linux/p/7100934.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!