我在AWS上有一个elastsicsearch实例(我有一个类似的工作正常。
我有一个lambda函数,可以将日志发送到elasticsearch。一段时间后它停止工作,现在我看不到任何新的日志。我查看了日志,发现了这个:
org.elasticsearch.transport.RemoteTransportException: [tqStC42][10.0.1.90:9300][indices:data/read/search[phase/query]]
Caused by: java.lang.IllegalArgumentException: size must be positive, got 0
at org.elasticsearch.search.aggregations.bucket.BucketUtils.suggestShardSideQueueSize(BucketUtils.java:40) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.search.aggregations.bucket.terms.TermsAggregatorFactory.doCreateInternal(TermsAggregatorFactory.java:100) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.search.aggregations.support.ValuesSourceAggregatorFactory.createInternal(ValuesSourceAggregatorFactory.java:55) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.search.aggregations.AggregatorFactory.create(AggregatorFactory.java:225) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.search.aggregations.AggregatorFactories.createTopLevelAggregators(AggregatorFactories.java:102) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.search.aggregations.AggregationPhase.preProcess(AggregationPhase.java:61) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:104) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.indices.IndicesService.lambda$loadIntoContext$18(IndicesService.java:1159) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.indices.IndicesService.lambda$cacheShardLevelResult$20(IndicesService.java:1229) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.indices.IndicesRequestCache$Loader.load(IndicesRequestCache.java:150) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.indices.IndicesRequestCache$Loader.load(IndicesRequestCache.java:133) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.common.cache.Cache.computeIfAbsent(Cache.java:398) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.indices.IndicesRequestCache.getOrCompute(IndicesRequestCache.java:116) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.indices.IndicesService.cacheShardLevelResult(IndicesService.java:1235) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.indices.IndicesService.loadIntoContext(IndicesService.java:1158) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.search.SearchService.loadOrExecuteQueryPhase(SearchService.java:257) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:273) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.action.search.SearchTransportService$6.messageReceived(SearchTransportService.java:300) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.action.search.SearchTransportService$6.messageReceived(SearchTransportService.java:297) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:69) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.transport.TransportService$6.doRun(TransportService.java:577) [elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:527) [elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-5.1.1.jar:5.1.1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_111]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_111]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111]
我对群集运行状况进行了卷曲(黄色,因为一个节点)
{
"cluster_name":"Pixel",
"status":"yellow",
"timed_out":false,
"number_of_nodes":1,
"number_of_data_nodes":1,
"active_primary_shards":11,
"active_shards":11,
"relocating_shards":0,
"initializing_shards":0,
"unassigned_shards":11,
"delayed_unassigned_shards":0,
"number_of_pending_tasks":0,
"number_of_in_flight_fetch":0,
"task_max_waiting_in_queue_millis":0,
"active_shards_percent_as_number":50.0
}
关于实例的更多信息: 它在m4.4xlarge上有100 GB的EBS。它还使用32 GB内存。到目前为止,在一个索引中有600,000条记录。
我还应该寻找什么?
我也抓了碎片
pixel 1 p STARTED 130527 74.7mb 10.0.1.90 tqStC42
pixel 1 r UNASSIGNED
pixel 3 p STARTED 129687 74.4mb 10.0.1.90 tqStC42
pixel 3 r UNASSIGNED
pixel 2 p STARTED 130561 74mb 10.0.1.90 tqStC42
pixel 2 r UNASSIGNED
pixel 4 p STARTED 129870 74.6mb 10.0.1.90 tqStC42
pixel 4 r UNASSIGNED
pixel 0 p STARTED 129981 74.4mb 10.0.1.90 tqStC42
pixel 0 r UNASSIGNED
答案 0 :(得分:1)
您获得的错误是因为您有一个聚合查询,可能是terms
,significant_terms
或geohash_grid
聚合查询,您已在其中指定了"size": 0
获得所有可能的条款。
这在ES 2.x和早期版本中是可行的,但是not anymore since ES 5.x因为这会极大地损害性能。现在,如果你想得到给定字段的所有项,你必须明确设置一个像"size": 1000
这样的高数字或者对你有意义的数字,它只需要一个比你字段的基数更大的数字。