wait_for_active_shards

编辑

wait_for_active_shards

编辑

此设置由 重新索引滚动压缩 操作使用。每个操作都以类似的方式使用它。

此设置确定客户端返回之前必须处于活动状态的分片副本数量。默认值为 1,这意味着仅限主分片。

对于所有分片副本,设置为 all,否则设置为任何非负值,该值小于或等于分片的副本总数(副本数 + 1)

阅读 Elasticsearch 文档 以获取更多信息。

重新索引

编辑
actions:
  1:
    description: "Reindex index1,index2,index3 into new_index"
    action: reindex
    options:
      wait_interval: 9
      max_wait: -1
      wait_for_active_shards: 2
      request_body:
        source:
          index: ['index1', 'index2', 'index3']
        dest:
          index: new_index
    filters:
    - filtertype: none

滚动

编辑
action: rollover
description: >-
  Rollover the index associated with alias 'name', which should be in the
  form of prefix-000001 (or similar), or prefix-yyyy.MM.DD-1.
options:
  name: aliasname
  conditions:
    max_age: 1d
    max_docs: 1000000
  wait_for_active_shards: 1
  extra_settings:
    index.number_of_shards: 3
    index.number_of_replicas: 1
  timeout_override:
  continue_if_exception: False
  disable_action: False

压缩

编辑
action: shrink
description: >-
  Shrink selected indices on the node with the most available space.
  Prepend target index names with 'foo-' and append a suffix of '-shrink'
options:
  shrink_node: DETERMINISTIC
  wait_for_active_shards: all
filters:
  - filtertype: ...