32

Why do I get these warnings after adding more data to my elasticsearch? And the warnings are different every time I browse the dashboard.

"Courier Fetch: 30 of 60 shards failed."

Example 1

Example 2

More details:

It's a sole node on a CentOS 7.1

/etc/elasticsearch/elasticsearch.yml

index.number_of_shards: 3
index.number_of_replicas: 1

bootstrap.mlockall: true

threadpool.bulk.queue_size: 1000
indices.fielddata.cache.size: 50%
threadpool.index.queue_size: 400
index.refresh_interval: 30s

index.number_of_shards: 5
index.number_of_replicas: 1

/usr/share/elasticsearch/bin/elasticsearch.in.sh

ES_HEAP_SIZE=3G

#I use this Garbage Collector instead of the default one.

JAVA_OPTS="$JAVA_OPTS -XX:+UseG1GC"

cluster status

{
  "cluster_name" : "my_cluster",
  "status" : "yellow",
  "timed_out" : false,
  "number_of_nodes" : 1,
  "number_of_data_nodes" : 1,
  "active_primary_shards" : 61,
  "active_shards" : 61,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 61
}

cluster details

{
  "cluster_name" : "my_cluster",
  "nodes" : {
    "some weird number" : {
      "name" : "ES 1",
      "transport_address" : "inet[localhost/127.0.0.1:9300]",
      "host" : "some host",
      "ip" : "150.244.58.112",
      "version" : "1.4.4",
      "build" : "c88f77f",
      "http_address" : "inet[localhost/127.0.0.1:9200]",
      "process" : {
        "refresh_interval_in_millis" : 1000,
        "id" : 7854,
        "max_file_descriptors" : 65535,
        "mlockall" : false
      }
    }
  }
}

I'm curious about the "mlockall" : false because on the yml I did write bootstrap.mlockall: true

logs

lots of lines like:

org.elasticsearch.common.util.concurrent.EsRejectedExecutionException: rejected execution (queue capacity 1000) on org.elasticsearch.search.action.SearchServiceTransportAction$23@a9a34f5
4

7 回答 7

27

对我来说,调整线程池搜索 queue_size 解决了这个问题。我尝试了许多其他事情,这是解决它的事情。

我将此添加到我的 elasticsearch.yml

threadpool.search.queue_size: 10000

然后重新启动elasticsearch。

推理...(来自文档)

一个节点拥有多个线程池,以改进在节点内管理线程内存消耗的方式。这些池中的许多还具有与之关联的队列,这允许挂起的请求被保留而不是被丢弃。

特别是对于搜索...

用于计数/搜索操作。默认为固定大小,int((# of available_processors * 3) / 2) + 1, queue_size 为 1000。

有关更多信息,您可以在此处参考 elasticsearch文档...

我很难找到这些信息,所以我希望这对其他人有帮助!

于 2015-09-03T14:21:16.020 回答
9

当我的查询缺少结束引号时出现此错误:

field:"value

Courier Fetch:35 个分片中有 5 个失败。

在我的 ElasticSearch 日志中,我看到了以下异常:

Caused by: org.elasticsearch.index.query.QueryShardException:
    Failed to parse query [field:"value]
...
Caused by: org.apache.lucene.queryparser.classic.ParseException: 
    Cannot parse 'field:"value': Lexical error at line 1, column 13.  
    Encountered: <EOF> after : "\"value"
于 2018-02-22T14:43:12.917 回答
7

使用 Elasticsearch 5.4 thread_pool 有一个下划线它。

thread_pool.search.queue_size: 10000

请参阅Elasticsearch 线程池模块文档中的文档

于 2017-06-12T05:16:38.683 回答
4

这可能表明您的集群运行状况存在问题。在不了解有关您的集群的更多信息的情况下,无话可说。

于 2015-05-05T13:26:19.357 回答
1

我同意@Philip 的观点,但至少在 Elasticsearch >=1.5.2 时有必要重新启动 elasticsearch,因为您可以动态设置threadpool.search.queue_size.

curl -XPUT http://your_es:9200/_cluster/settings
{
    "transient":{
        "threadpool.search.queue_size":10000
    }
}
于 2015-11-25T06:15:33.110 回答
0

这不适用于 elasticsearch 5.6。

{
"error": {
    "root_cause": [
        {
            "type": "remote_transport_exception",
            "reason": "[colmbmiscxx.xx][172.29.xx.xx:9300][cluster:admin/settings/update]"
        }
    ],
    "type": "illegal_argument_exception",
    "reason": "transient setting [threadpool.search.queue_size], not dynamically updateable"
},
"status": 400

}

于 2019-05-14T11:09:12.213 回答
0

从 Elasticsearch >= 版本 5 开始,无法使用 _cluster/settings API 更新 thread_pool.search.queue_size 的集群设置。在我的情况下,更新 ElasticSearch 节点 yml 文件也不是一种选择,因为如果节点失败,那么自动缩放代码将为其他 ES 节点带来默认的 yml 设置。

我有一个有 3 个节点的集群,并且有 400 个活动主分片和 7 个活动线程,队列大小为 1000。将具有类似配置的节点数量增加到 5 个已经解决了这个问题,因为查询水平分布到更多可用节点。

于 2018-02-07T12:04:50.290 回答