Courier Fetch:分片失败

问题描述 投票:0回答:8

为什么我在向 elasticsearch 添加更多数据后会收到这些警告? 每次我浏览仪表板时警告都不同。

“Courier Fetch:60 个分片中有 30 个失败。”

Example 1

Example 2

更多详情:

它是 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_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_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
      }
    }
  }
}

我很好奇 "mlockall" : false 因为在 yml 上我确实写了 bootstrap.mlockall: true

日志

很多行,例如:

org.elasticsearch.common.util.concurrent.EsRejectedExecutionException: rejected execution (queue capacity 1000) on org.elasticsearch.search.action.SearchServiceTransportAction$23@a9a34f5
elasticsearch kibana kibana-4
8个回答
26
投票

对我来说,调整线程池搜索 queue_size 解决了这个问题。我尝试了很多其他的东西,这就是解决它的方法。

我将其添加到我的 elasticsearch.yml

threadpool.search.queue_size: 10000

然后重新启动elasticsearch.

推理...(来自文档)

一个节点拥有多个线程池,以改善线程的运行方式 内存消耗在节点内进行管理。其中许多游泳池还 有与之相关联的队列,允许挂起的请求 持有而不是丢弃。

特别是搜索...

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

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

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


9
投票

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

field:"value

在我的 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"

7
投票

使用 Elasticsearch 5.4 thread_pool 有下划线。

thread_pool.search.queue_size: 10000

参见 Elasticsearch 线程池模块文档


4
投票

这可能表明集群的健康状况存在问题。在不了解您的集群的情况下,没有太多可以说的了。


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
    }
}

0
投票

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

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


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

}


0
投票

对我来说,调整线程池搜索 queue_size 解决了这个问题。我尝试了很多其他的方法,这是解决它的方法。我将它添加到我的 elasticsearch.yml threadpool.search.queue_size: 10000 然后重新启动elasticsearch。 推理......(来自文档) 一个节点拥有多个 limelight tracking 线程池,以改进节点内管理线程内存消耗的方式。许多这些池也有与之关联的队列,这允许挂起而不是丢弃未决请求。 尤其是搜索... 用于计数/搜索操作。默认固定大小为 int((# of available_processors * 3) / 2) + 1,queue_size 为 1000。 有关更多信息,您可以在此处参考 elasticsearch 文档...我找不到此信息,所以我希望这对其他人有帮助! 在我的例子中,更新 ElasticSearch 节点 yml 文件也不是一个选项,因为如果节点失败,那么自动缩放代码会给其他 ES 节点带来默认的 yml 设置。

我有一个有 3 个节点的集群,有 400 个活动主分片和 7 个活动线程,队列大小为 1000。使用类似配置将节点数量增加到 5 已经解决了这个问题,因为查询正在水平分布到更多可用节点。这是一个问题而不是一个答案?检查您正在使用的 Kibana 查询,似乎没有正确“引用”。无法解析查询[字段:“值”。你能提供更多细节吗?

© www.soinside.com 2019 - 2024. All rights reserved.