如何配置"search.max_open_scroll_context";在elasticsearch中? [英] How to configure "search.max_open_scroll_context" in elasticsearch?

查看:1455
本文介绍了如何配置"search.max_open_scroll_context";在elasticsearch中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 scroll 在elasticsearch中获取数据(版本:7.0.0).但是,当我使用它时,抛出了异常.

I an using scroll to get data in elasticsearch (version: 7.0.0). However, when I used it, the exception was thrown.

  • 请求:
GET /index-name/_search?scroll=1m
{
    "size": 100,
    "query": {
        "match_all" : {}
    }
}

  • 响应
  • {
      "error": {
        "root_cause": [
          {
            "type": "exception",
            "reason": "Trying to create too many scroll contexts. Must be less than or equal to: [500]. This limit can be set by changing the [search.max_open_scroll_context] setting."
          }
        ],
        "type": "search_phase_execution_exception",
        "reason": "all shards failed",
        "phase": "query",
        "grouped": true,
        "failed_shards": [
          {
            "shard": 0,
            "index": "nr-v1",
            "node": "jVqXndodRtqsZ4Srh9eHSg",
            "reason": {
              "type": "exception",
              "reason": "Trying to create too many scroll contexts. Must be less than or equal to: [500]. This limit can be set by changing the [search.max_open_scroll_context] setting."
            }
          }
        ]
      },
      "status": 500
    }
    

    然后我使用 GET/_nodes/stats/indices/search 检查节点状态,响应:

    And I check the node status using GET /_nodes/stats/indices/search, the response:

    {
      "_nodes": {
        "total": 3,
        "successful": 3,
        "failed": 0
      },
      "cluster_name": "bprc",
      "nodes": {
        "AdT9tX_jRqiuRyNnYunRdg": {
          "timestamp": 1557036722528,
          "name": "es2",
          "transport_address": "192.168.99.74:9300",
          "host": "192.168.99.74",
          "ip": "192.168.99.74:9300",
          "roles": [
            "master",
            "data",
            "ingest"
          ],
          "attributes": {
            "ml.machine_memory": "16819453952",
            "ml.max_open_jobs": "20",
            "xpack.installed": "true"
          },
          "indices": {
            "search": {
              "open_contexts": 502,
              "query_total": 3171,
              "query_time_in_millis": 2490,
              "query_current": 0,
              "fetch_total": 538,
              "fetch_time_in_millis": 951,
              "fetch_current": 0,
              "scroll_total": 2020,
              "scroll_time_in_millis": 1948250008,
              "scroll_current": 502,
              "suggest_total": 0,
              "suggest_time_in_millis": 0,
              "suggest_current": 0
            }
          }
        },
    ......
    

    我的问题:1.如何解决有关尝试创建太多滚动上下文.必须小于或等于[500]"的例外的问题.

    My question: 1. How to fix the problem about the exception that "Trying to create too many scroll contexts. Must be less than or equal to: [500]."

              "scroll_total": 2020,
              "scroll_time_in_millis": 1948250008,
              "scroll_current": 502
    

    这三个属性的作用是什么?

    what is the function of the three attributes?

    推荐答案

    我能够通过增加滚动上下文的最大数量来解决此问题:

    I was able to fix this issue by increasing the maximum number of scroll contexts:

    curl -x "" -X PUT localhost:9200/_cluster/settings -H 'Content-Type: application/json' -d'{
        "persistent" : {
            "search.max_open_scroll_context": 1024
        },
        "transient": {
            "search.max_open_scroll_context": 1024
        }
    }'
    

    这篇关于如何配置"search.max_open_scroll_context";在elasticsearch中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆