加载中

降采样 (Downsample)

允许的阶段:hot、warm、cold。

聚合时间序列 (TSDS) 索引,并为按配置的时间间隔分组的每个指标字段存储预先计算的统计摘要(minmaxsumvalue_count)。例如,包含每 10 秒采样一次的指标的 TSDS 索引可以降采样为按小时计算的索引。一小时时间间隔内的所有文档都会被汇总并存储为单个文档,然后存储在降采样索引中。

此操作对应于 downsample API

生成的降采样索引名称为 downsample-<original-index-name>-<random-uuid>。如果 ILM 对数据流的后备索引执行 downsample 操作,则降采样索引将成为同一数据流的后备索引,并且源索引会被删除。

要在 hot 阶段使用 downsample 操作,必须存在 rollover 操作。如果未配置 rollover 操作,ILM 将拒绝该策略。

fixed_interval
(必填,字符串)数据将被降采样到的固定时间间隔
force_merge_index
(可选,布尔值)为 true 时,降采样后的索引将被强制合并为一个段 (segment)。默认为 true
sampling_method
(可选,字符串)用于对指标进行采样的采样方法;有两种可用方法:aggregatelast_value。默认为 aggregate
				PUT _ilm/policy/datastream_policy
					{
  "policy": {
    "phases": {
      "hot": {
        "actions": {
          "rollover": {
            "max_docs": 1
          },
          "downsample": {
  	          "fixed_interval": "1h",
  	          "force_merge_index": false
  	      }
        }
      }
    }
  }
}
		
© . 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.