【问题标题】:Index Cleanup and Retention Elastic Cloud索引清理和保留 Elastic Cloud
【发布时间】:2019-11-14 15:33:28
【问题描述】:

我很难找到明确的答案:Elastic Cloud (ELK Stack) 中的索引在删除前的默认保留时间是多少,是否可以轻松修改?我们最近从本地 ELK 堆栈迁移到云解决方案。以前我们是用 Curator 做的。

我发现的最后一个帖子是 2017 年的,并说云端不支持此功能:https://discuss.elastic.co/t/configure-retention-period-for-different-index/106491 这有变化吗?

【问题讨论】:

    标签: elasticsearch elastic-cloud


    【解决方案1】:

    我通过使用索引生命周期管理 (ILM) 和索引模板创建翻转来解决这个问题。大部分信息都可以在这里找到:https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-rollover-index.html

    但它的要点是:

    创建 ILM

    使用翻转别名创建索引模板:

    PUT _template/example-template-name
    {
      "index_patterns": [
        "example-index-*"
      ],
      "settings": {
        "index": {
          "lifecycle": {
            "name": "name-of-lifecycle-created-earlier",
            "rollover_alias": "example-index-name"
          }
        }
      }
    }
    

    然后创建具有翻转别名别名的第一个索引。我个人使用翻转日期系统,带有 URL 编码:

    PUT /%3Cexample-index-name-%7Bnow%2Fd%7D-1%3E
    {
      "aliases": {
        "example-index-name": {
          "is_write_index" : true
        }
      }
    }
    

    在此之后只需写入别名,而不是索引本身。当满足 ILM 限制时,它将自动分配正确的索引和翻转。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-08-19
      • 1970-01-01
      • 1970-01-01
      • 2014-02-09
      • 2021-06-27
      • 2020-01-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多