根据此文档,我们尝试将策略设置为索引模式
PUT _opendistro/_ism/policies/hot_delete_rule_for_log
{
"policy": {
"description": "hot delete rule for log",
"default_state": "hot",
"states": [
{
"name": "hot",
"actions": [],
"transitions": [
{
"state_name": "delete",
"conditions": {
"min_index_age": "20d"
}
}
]
},
{
"name": "delete",
"actions": [
{
"delete": {}
}
],
"transitions": []
}
],
"ism_template": {
"index_patterns": ["log-*"],
"priority": 1
}
}
}
然后我们通过检查索引设置GET log-2021.06.29/_settings
{
"log-2021.06.29" : {
"settings" : {
"index" : {
"mapping" : {
"total_fields" : {
"limit" : "10000"
}
},
"refresh_interval" : "5s",
"number_of_shards" : "1",
"provided_name" : "log-2021.06.29",
"max_docvalue_fields_search" : "200",
"query" : {
"default_field" : [ "fields.*" ]
},
"creation_date" : "1624924801281",
"number_of_replicas" : "0",
"uuid" : "SfG2Utr5RDmybrH2Q",
"version" : {
"created" : "7100299"
}
}
}
}
}
政策似乎未正确应用于索引?还是我错过了什么?
PS:所有这些命令都在 aws ElasticSearch 上运行