ES 索引生命周期管理(ilm)最佳实践

一、ES索引生命周期(ilm)介绍

es索引生命周期阶段介绍及状态转换

二、滚动索引的创建步骤

第一步,创建policy:

PUT _ilm/policy/test_max_doc_cnt_policy
{
  "policy": {
    "phases": {
      "hot": {
        "min_age": "0ms",
        "actions": {
          "rollover": {
            "max_age": "1d"
          },
          "set_priority": {
            "priority": 100
          }
        }
      },
      "delete": {
        "min_age": "3d",
        "actions": {
          "delete": {}
        }
      }
    }
  }
}

第二步,创建模版:


PUT _template/test_max_doc_cnt_index_pattern
{
  "index_patterns": "test-max-doc-cnt-index*",
  "settings": {
    "number_of_shards": 1,
    "number_of_replicas": 1,
    "index.lifecycle.name": "test_max_doc_cnt_policy",
    "index.lifecycle.rollover_alias": "test_max_doc_cnt_index"
  },
  "mappings": {
    "properties": {
      "name": {
        "type": "text"
      },
      "age": {
        "type": "double"
      }
    }
  }
}

第三步,创建第一个索引:

https://www.elastic.co/guide/en/elasticsearch/reference/7.2/date-math-index-names.html

PUT /%3Ctest-max-doc-cnt-index-%7Bnow%2Fd%7D-000001%3E
{
  "aliases": {
    "test_max_doc_cnt_index": {
      "is_write_index": true
    }
  }
}

第四步,写入数据:

POST /test_max_doc_cnt_index/_doc/01
{
  "name":"name01"
}

三、超大规模索引的最佳实践
超大索引的管理及冷热集群的管理

  • 字段优化
  • 分词优化
  • 查询优化
  • 节点优化
  • 存储优化
  • 集群优化
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值