fetch_size Elasticsearch参数的值可以增加吗?

vcirk6k6  于 2023-01-29  发布在  ElasticSearch
关注(0)|答案(1)|浏览(187)

enrich.fetch_size-将源索引重新索引为丰富索引时的最大批处理大小。默认值为10000。
如果elasticsearch.yml中的值更改为例如20000,则在执行ingest policy时会出现错误

{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "Batch size is too large, size must be less than or equal to: [10000] but was [20000]. Scroll batch sizes cost as much memory as result windows so they are controlled by the [index.max_result_window] index level setting."
      }
    ],
    "type" : "search_phase_execution_exception",
    "reason" : "Partial shards failure",
    "phase" : "query",
    "grouped" : true,
    "failed_shards" : [
      {
        "shard" : 0,
        "index" : "name-of-index",
        "node" : "node-id",
        "reason" : {
          "type" : "illegal_argument_exception",
          "reason" : "Batch size is too large, size must be less than or equal to: [10000] but was [20000]. Scroll batch sizes cost as much memory as result windows so they are controlled by the [index.max_result_window] index level setting."
        }
      }
    ]
  },
  "status" : 400
}

配置文件:

...
discovery:
  seed_hosts:
    - "127.0.0.1"
    - "[::1]"
    - elasticsearch

script:
  context:
    template:
      max_compilations_rate: 400/5m
      cache_max_size: 400

enrich:
  fetch_size: 20000
...
goucqfw6

goucqfw61#

这是一个很常见的错误,我认为你还没有重新启动你的Elasticsearch服务器和新的变化elasticsearch.yml没有加载。
如果重新启动后问题没有解决,请共享您的配置文件。将不得不看一看它。

相关问题