我正在研究Sonarqube 5.1。它以前工作得很好,后来我在设备错误上没有剩余空间。所以我删除了一些不需要的文件并重新启动了服务。现在我可以看到服务状态正在运行,但我无法访问该网页(因为声纳webservice未启动) 我检查了日志,发现以下错误。
2015.08.03 10:58:56 INFO es[o.elasticsearch.node] [sonar-1438592314778] started
2015.08.03 10:59:03 INFO es[o.e.gateway] [sonar-1438592314778] recovered [6] indices into cluster_state
2015.08.03 11:00:44 WARN es[o.e.indices.cluster] [sonar-1438592314778] [sourcelines][0] failed to start shard
org.elasticsearch.index.gateway.IndexShardGatewayRecoveryException: [sourcelines][0] failed to recover shard
at org.elasticsearch.index.gateway.local.LocalIndexShardGateway.recover(LocalIndexShardGateway.java:287) ~[elasticsearch-1.4.4.jar:na]
at org.elasticsearch.index.gateway.IndexShardGatewayService$1.run(IndexShardGatewayService.java:132) ~[elasticsearch-1.4.4.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:114 2) [na:1.8.0_40]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_40]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_40]
Caused by: org.elasticsearch.index.translog.TranslogCorruptedException: translog corruption while reading from stream
at org.elasticsearch.index.translog.ChecksummedTranslogStream.read(ChecksummedTranslogStream.java:70) ~[elasticsearch-1.4.4.jar:na]
at org.elasticsearch.index.gateway.local.LocalIndexShardGateway.recover(LocalIndexShardGateway.java:257) ~[elasticsearch-1.4.4.jar:na]
... 4 common frames omitted
Caused by: org.elasticsearch.ElasticsearchException: failed to read [sourceline][22c2d1d1-8e73-47c0-b9fa-f8f5cc96b93f_796]
at org.elasticsearch.index.translog.Translog$Index.readFrom(Translog.java:520) ~[elasticsearch-1.4.4.jar:na]
at org.elasticsearch.index.translog.ChecksummedTranslogStream.read(ChecksummedTranslogStream.java:68) ~[elasticsearch-1.4.4.jar:na]
... 5 common frames omitted
Caused by: org.elasticsearch.ElasticsearchIllegalArgumentException: No version type match [105]
at org.elasticsearch.index.VersionType.fromValue(VersionType.java:307) ~[elasticsearch-1.4.4.jar:na]
at org.elasticsearch.index.translog.Translog$Index.readFrom(Translog.java:517) ~[elasticsearch-1.4.4.jar:na]
... 6 common frames omitted
2015.08.03 11:00:44 WARN es[o.e.c.action.shard] [sonar-1438592314778] [sourcelines][0] sending failed shard for [sourcelines][0], node[5eRgYcVUTNCNLjhhzdiHGA], [P], s[INITIALIZING], indexUUID [JaH5lnRnRVOFD95Nw28W5Q], reason [Failed to start shard, message [IndexShardGatewayRecoveryException[[sourcelines][0] failed to recover shard]; nested: TranslogCorruptedException[translog corruption while reading from stream]; nested: ElasticsearchException[failed to read [sourceline][22c2d1d1-8e73-47c0-b9fa-f8f5cc96b93f_796]]; nested: ElasticsearchIllegalArgumentException[No version type match [105]]; ]]
2015.08.03 11:00:44 WARN es[o.e.c.action.shard] [sonar-1438592314778] [sourcelines][0] received shard failed for [sourcelines][0], node[5eRgYcVUTNCNLjhhzdiHGA], [P], s[INITIALIZING], indexUUID [JaH5lnRnRVOFD95Nw28W5Q], reason [Failed to start shard, message [IndexShardGatewayRecoveryException[[sourcelines][0] failed to recover shard]; nested: TranslogCorruptedException[translog corruption while reading from stream]; nested: ElasticsearchException[failed to read [sourceline][22c2d1d1-8e73-47c0-b9fa-f8f5cc96b93f_796]]; nested: ElasticsearchIllegalArgumentException[No version type match [105]]; ]]
我必须删除分片吗?如果是的话怎么做?如何恢复碎片? 索引错了吗?我在哪里可以找到我的机器上的[sourcelines]? 帮助我。
提前谢谢你。
答案 0 :(得分:18)
您的ES索引似乎已损坏。
所有基本信息都存储在DB中。请勿手动删除或更新。
相反,如果删除ES索引,它们将在下次启动时重建(这可能需要一些时间,具体取决于您拥有的数据量)。
要实现这一点,请删除SQ实例的es
目录中的data
目录。
答案 1 :(得分:3)
我们多次遇到过这个问题。我们删除SQ实例的$ SONAR_HOME / data目录下的es目录并重启SQ实例。它再次启动索引 注意:只有您将面临的问题,在索引编制期间,您的SQ网络服务器将无法访问。您无法浏览localhost:9000(除非索引结束,否则它将继续加载)。由于我们的项目很大,完成索引需要几个小时。完成索引后,您可以浏览您的SQ网络服务器。
答案 2 :(得分:1)
如果您正在使用数据库来存储声纳分析的结果,那么清除数据库一次然后再次启动声纳,因为它有时会搞乱存储在数据库中的新旧结果。它不会对您的文件进行索引。
答案 3 :(得分:1)
删除translog文件夹中的.recovery文件
例如:/es/elasticsearch-1.7.1/data/ [elasticsearch_clustername] /节点/ 0 /索引/ [INDEXNAME] / 2 /超越对/
答案 4 :(得分:0)
有一种方法可以专门修复Elasticsearch的跨日志损坏,此问题在此受到影响。接受的答案会导致较高的服务器开销,并且似乎会接受很多数据丢失。 第一步,请看一下我的回复(类似于Balaji的回复,但使用的是官方工具):Elastic Search IndexShardGatewayRecoveryException