8

我正在Sonarqube 5.1上工作。它曾經工作得很好,以後我得到這個沒有留下設備錯誤的空間。所以我刪除了一些不需要的文件並重新啓動了服務。現在我可以看到服務狀態正在運行,但我無法訪問網頁(因爲聲吶web服務未啓動) 我檢查了日誌,發現下面的錯誤。無法啓動Sonar 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]? 幫助我。

提前謝謝。

回答

15

您的ES索引似乎已損壞。

所有的基礎信息都存儲在數據庫中。不要手動刪除或更新它。相反,如果刪除ES索引,它們將在下次啓動時重建(根據數據量的不同,這可能需要一些時間)。

爲了達到這個目的,刪除SQ實例的data目錄中的es目錄。

+0

注意:從SonarQube 6.6開始,該目錄被命名爲'es5',而不是'es' –

1

如果你使用數據庫來存儲聲納分析的結果,那麼清理一次數據庫,然後再次啓動聲納,因爲它有時會混淆在數據庫中存儲的新舊結果。它不會對文件進行索引。

3

我們多次遇到這個問題。我們刪除SQ實例的$ SONAR_HOME/data目錄下的es目錄並重新啓動SQ實例。它再次開始索引 注意:只有在編制索引期間您將遇到的問題將無法訪問您的SQ web服務器。你不能瀏覽你的本地主機:9000(它將繼續加載,除非索引結束)。由於我們的項目很大,完成索引需要幾個小時。完成索引編制後,您可以瀏覽SQ web服務器。

1

刪除.recovery文件超越對文件夾內

例如:/es/elasticsearch-1.7.1/data/ [elasticsearch_clustername] /節點/ 0 /索引/ [INDEXNAME]/2 /超越對/