我有一個測試ElasticSearch框(2.3.0),我的測試使用ES失敗的隨機順序,真是令人沮喪(失敗,所有碎片失敗異常)。ElasticSearch運行測試時隨機失敗
望着elastic_search.log
文件只給我看了這個
[2017-05-04 04:19:15,990][DEBUG][action.search.type ] [es-testing-1] All shards failed for phase: [query]
RemoteTransportException[[es-testing-1][127.0.0.1:9300][indices:data/read/search[phase/query]]]; nested: IllegalIndexShardStateException[CurrentState[RECOVERING] operations only allowed when shard state is one of [POST_RECOVERY, STARTED, RELOCATED]];
Caused by: [derp_test][[derp_test][3]] IllegalIndexShardStateException[CurrentState[RECOVERING] operations only allowed when shard state is one of [POST_RECOVERY, STARTED, RELOCATED]]
at org.elasticsearch.index.shard.IndexShard.readAllowed(IndexShard.java:993)
at org.elasticsearch.index.shard.IndexShard.acquireSearcher(IndexShard.java:814)
at org.elasticsearch.search.SearchService.createContext(SearchService.java:641)
at org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:618)
at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:369)
at org.elasticsearch.search.action.SearchServiceTransportAction$SearchQueryTransportHandler.messageReceived(SearchServiceTransportAction.java:368)
at org.elasticsearch.search.action.SearchServiceTransportAction$SearchQueryTransportHandler.messageReceived(SearchServiceTransportAction.java:365)
at org.elasticsearch.transport.TransportService$4.doRun(TransportService.java:350)
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
任何想法是怎麼回事?到目前爲止,我的研究只告訴我這很可能是由於腐敗的超時日誌 - 但我不認爲刪除超時日誌將會有所幫助,因爲測試將丟掉每個命名空間的測試索引
ES測試盒具有3.5GB RAM,使用2.5GB堆大小,CPU使用率是在測試過程中相當正常(15%達到峯值)
澄清:當我說失敗測試,餘與怪異異常意味着誤差以上(未失敗的測試如所提到的由於值不正確)。每次插入/更新操作後,我都進行了手動刷新,因此值是正確的。
活躍(https://www.elastic.co /guide/en/elasticsearch/reference/current/integration-tests.html)進行集成測試? – chengpohi
@chengpohi不,目前它只是把測試盒視爲一個普通的es盒子。這是一個反模式還是什麼? – GantengX