ES类的索引轮换

通过以下请求方法创建一个名为 "tiered-storage-policy" 的 ISM policy:

PUT _plugins/_ism/policies/tiered-storage-policy

json 复制代码
{
  "policy": {
    "description": "Changes replica count and deletes.",
    "schema_version": 1,
    "default_state": "current",
    "states": [{
        "name": "current",
        "actions": [],
        "transitions": [{
          "state_name": "old",
          "conditions": {
            "min_index_age": "7d"
          }
        }]
      },
      {
        "name": "old",
        "actions": [{
          "replica_count": {
            "number_of_replicas": 0
          }
        }],
        "transitions": [{
          "state_name": "delete",
          "conditions": {
            "min_index_age": "21d"
          }
        }]
      },
      {
        "name": "delete",
        "actions": [{
          "delete": {}
        }],
        "transitions": []
      }
    ]
  }
}

创建策略后,请将它附加到一个或多个索引:

json 复制代码
POST _plugins/_ism/add/my-index
{
  "policy_id": "my-policy-id"
}
``
相关推荐
bemyrunningdog7 分钟前
IntelliJIDEA上传GitHub全攻略
大数据·elasticsearch·搜索引擎
失因43 分钟前
Linux 权限管理与 ACL 访问控制
linux·运维·服务器·数据库·centos
小醉你真好1 小时前
Spring Boot + ShardingSphere 分库分表实战
java·spring boot·后端·mysql
玖剹1 小时前
Linux文件操作:从C接口到系统调用
linux·服务器·c语言·c++·笔记·ubuntu
Vdeilae2 小时前
IIS 让asp.net core 项目一直运行
java·服务器·asp.net
YY_TJJ2 小时前
8.4 Java Web(Maven P50-P57)
java·开发语言·maven
cc蒲公英2 小时前
uniapp x swiper/image组件mode=“aspectFit“ 图片有的闪现后黑屏
java·前端·uni-app
刘大辉在路上2 小时前
IntelliJ IDEA开发编辑器摸鱼看股票数据
java·编辑器·intellij-idea
Lovyk2 小时前
Linux 系统启动原理
linux·服务器·windows
藏在歌词里3 小时前
Linux-Shell脚本基础用法
linux·运维·服务器