加载中

滚动操作

action: rollover
description: >-
  Rollover the index associated with alias 'aliasname', 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
    max_size: 5gb
		

如果满足所描述的任何条件,此操作将使用 Elasticsearch Rollover API 创建一个新索引。

重要提示

选择 conditions 时,可以使用 max_agemax_docsmax_size 中的任意一个或者三者的任意组合。如果使用了多个条件,则必须满足其中任何一个条件才会触发滚动。

警告

如果提供了 max_agemax_docsmax_size 选项中的一个或多个,它们必须各自具有一个值。由于没有默认值,这些条件都不能留空,否则 Curator 会报错。

extra_settings 选项允许添加额外的索引设置(但不能添加 mappings)。这些设置的一个使用示例可能是

action: rollover
description: >-
  Rollover the index associated with alias 'aliasname', 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
  extra_settings:
    index.number_of_shards: 3
    index.number_of_replicas: 1
  timeout_override:
  continue_if_exception: False
  disable_action: False
		
  • name 别名
  • max_age 触发滚动前允许的最大存活时间。此项必须嵌套在 conditions: 下。没有默认值。如果指定了此条件,它必须包含一个值,否则 Curator 会报错。
  • max_docs 触发滚动前索引中允许的最大文档数。此项必须嵌套在 conditions: 下。没有默认值。如果指定了此条件,它必须包含一个值,否则 Curator 会报错。
  • max_size 触发滚动前索引允许的最大大小。此项必须嵌套在 conditions: 下。没有默认值。如果指定了此条件,它必须包含一个值,否则 Curator 会报错。
提示

有关此操作在 actionfile 中的示例,请参见此处

© . This website operates independently and is not affiliated with or endorsed by Elasticsearch B.V. All brand names, logos, and trademarks are the property of their respective owners.