0

我正在使用 Elasticsearch Hot Warm Architecture 进行大型时间数据分析。我的策展人工作会将超过 2 天的索引的 box_type 从“热”节点设置为“热”节点。但是当我在 9 月 30 日晚上 18 点运行它时,9 月 28 日索引的 box_type 仍然“热”。我的策展人动作设置:

actions:
  1:
    action: open
    description: Open indices younger than warm days (based on index name), for logstash-
      prefixed indices.
    options:
      ignore_empty_list: true
      disable_action: false
    filters:
    - filtertype: age
      source: name
      direction: younger
      timestring: '%Y.%m.%d'
      unit: days
      unit_count: 30
    - filtertype: pattern
      kind: prefix
      value: logstash-
      exclude:

  2:
    action: allocation
    description: Apply shard allocation to hot nodes
    options:
      key: box_type
      value: hot
      allocation_type: require
      wait_for_completion: true
      timeout_override:
      continue_if_exception: false
      ignore_empty_list: true
      disable_action: false
    filters:
    - filtertype: age
      source: name
      direction: younger
      timestring: '%Y.%m.%d'
      unit: days
      unit_count: 2
    - filtertype: pattern
      kind: prefix
      value: logstash-

  3:
    action: allocation
    description: Apply shard allocation to warm nodes
    options:
      key: box_type
      value: warm
      allocation_type: require
      wait_for_completion: true
      timeout_override:
      continue_if_exception: false
      ignore_empty_list: true
      disable_action: false
    filters:
    - filtertype: age
      source: name
      direction: younger
      timestring: '%Y.%m.%d'
      unit: days
      unit_count: 30
    - filtertype: age
      source: name
      direction: older
      timestring: '%Y.%m.%d'
      unit: days
      unit_count: 2
    - filtertype: pattern
      kind: prefix
      value: logstash-

日志:

2018-09-30 18:38:26,053 - curator.py:55 - INFO -  Action ID: 1, "open" completed.
2018-09-30 18:38:26,053 - curator.py:55 - INFO -  Preparing Action ID: 2, "allocation"
2018-09-30 18:38:26,053 - curator.py:55 - INFO -  Trying Action ID: 2, "allocation": Apply shard allocation to hot nodes
2018-09-30 18:38:26,053 - curator.py:55 - INFO -  Updating index setting {'index.routing.allocation.require.box_type': 'hot'}
2018-09-30 18:38:26,053 - curator.py:55 - INFO -  Health Check for all provided keys passed.
2018-09-30 18:38:26,053 - curator.py:55 - INFO -  Action ID: 2, "allocation" completed.
2018-09-30 18:38:26,053 - curator.py:55 - INFO -  Preparing Action ID: 3, "allocation"
2018-09-30 18:38:26,053 - curator.py:55 - INFO -  Trying Action ID: 3, "allocation": Apply shard allocation to warm nodes
2018-09-30 18:38:26,053 - curator.py:55 - INFO -  Updating index setting {'index.routing.allocation.require.box_type': 'warm'}
2018-09-30 18:38:26,053 - curator.py:55 - INFO -  Health Check for all provided keys passed.
2018-09-30 18:38:26,053 - curator.py:55 - INFO -  Health Check for all provided keys passed.
2018-09-30 18:38:26,053 - curator.py:55 - INFO -  Health Check for all provided keys passed.
2018-09-30 18:38:26,053 - curator.py:55 - INFO -  Action ID: 3, "allocation" completed.

日志说操作已完成。9 月 28 日的索引 box_type 不应该是“温暖的”吗?

filtertype: age
      source: name
      direction: older
      timestring: '%Y.%m.%d'
      unit: days
      unit_count: 2

当我在 9 月 30 日晚上 18 点运行此过滤器时,它是否会将所有 9 月 28 日的索引 box_type 更改为暖色?

4

1 回答 1

0

时间从当天的 UTC 00:00开始计算,older而不是从执行时间开始计算,因此2 days取决于 UTC 00:00 何时在您的时区中。如果启用 DEBUG 日志记录,您可以在 curator 日志文件中查看时间是如何计算和测量的。

于 2018-10-01T23:32:31.543 回答