一、在dev tools命令窗口输入 _cat/plugins查看es集群安装的插件列表
如果安装了opendistro_index_management这个插件,就可以支持索引管理功能,可以创建索引策略。
二、下面是创建索引策略的步骤
三、下面是定义索引策略的模板内容:
{
"policy": {
"policy_id": "warm_30d_delete_workflow",
"description": "warm_30d_delete_workflow",
"last_updated_time": 1660548785549,
"schema_version": 1,
"error_notification": null,
"default_state": "warm",
"states": [
{
"name": "warm",
"actions": [],
"transitions": [
{
"state_name": "delete",
"conditions": {
"min_index_age": "30d"
}
}
]
},
{
"name": "delete",
"actions": [
{
"delete": {}
}
],
"transitions": []
}
]
}
}
四、关联索引模板
{
"order" : 0,
"version" : 60001,
"index_patterns" : [
"*"
],
"settings" : {
"index" : {
"highlight" : {
"max_analyzed_offset" : "10000000"
},
"routing" : {
"allocation" : {
"total_shards_per_node" : "-1"
}
},
"opendistro" : {
"index_state_management" : {
"policy_id" : "hot_warm_delete_workflow"
}
},
"refresh_interval" : "5s",
"number_of_shards" : "1",
"number_of_replicas" : "1"
}
},
"mappings" : {
........}
........
最后修改时间:2022-08-18 19:20:30
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。