fix ilm was not applied to index (#253)
Reviewed-on: https://git.infini.ltd/infini/console/pulls/253 Co-authored-by: liugq <silenceqi@hotmail.com> Co-committed-by: liugq <silenceqi@hotmail.com>
This commit is contained in:
parent
c434d3fb76
commit
62b4428f95
|
@ -41,6 +41,7 @@ PUT _template/$[[SETUP_TEMPLATE_NAME]]
|
||||||
"aliases": {}
|
"aliases": {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DELETE _ilm/policy/ilm_$[[SETUP_INDEX_PREFIX]]metrics-30days-retention
|
||||||
PUT _ilm/policy/ilm_$[[SETUP_INDEX_PREFIX]]metrics-30days-retention
|
PUT _ilm/policy/ilm_$[[SETUP_INDEX_PREFIX]]metrics-30days-retention
|
||||||
{
|
{
|
||||||
"policy": {
|
"policy": {
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
PUT _template/$[[SETUP_TEMPLATE_NAME]]
|
PUT _template/$[[SETUP_TEMPLATE_NAME]]
|
||||||
{
|
{
|
||||||
"order": 0,
|
|
||||||
"index_patterns": [
|
"index_patterns": [
|
||||||
"$[[SETUP_INDEX_PREFIX]]*"
|
"$[[SETUP_INDEX_PREFIX]]*"
|
||||||
],
|
],
|
||||||
|
"order": 0,
|
||||||
"settings": {
|
"settings": {
|
||||||
"index": {
|
"index": {
|
||||||
"max_result_window": "10000000",
|
"max_result_window": "10000000",
|
||||||
|
@ -47,7 +47,7 @@ PUT _plugins/_ism/policies/ilm_$[[SETUP_INDEX_PREFIX]]metrics-30days-retention
|
||||||
"description": "infini metrics hot delete workflow",
|
"description": "infini metrics hot delete workflow",
|
||||||
"default_state": "hot",
|
"default_state": "hot",
|
||||||
"ism_template": {
|
"ism_template": {
|
||||||
"index_patterns": ["$[[SETUP_INDEX_PREFIX]]metrics*"],
|
"index_patterns": ["$[[SETUP_INDEX_PREFIX]]metrics*", "$[[SETUP_INDEX_PREFIX]]logs*","$[[SETUP_INDEX_PREFIX]]requests_logging*","$[[SETUP_INDEX_PREFIX]]async_bulk_results*","$[[SETUP_INDEX_PREFIX]]alert-history*","$[[SETUP_INDEX_PREFIX]]activities*"],
|
||||||
"priority": 100
|
"priority": 100
|
||||||
},
|
},
|
||||||
"states": [
|
"states": [
|
||||||
|
@ -89,35 +89,17 @@ PUT _plugins/_ism/policies/ilm_$[[SETUP_INDEX_PREFIX]]metrics-30days-retention
|
||||||
|
|
||||||
PUT _template/$[[SETUP_INDEX_PREFIX]]metrics-rollover
|
PUT _template/$[[SETUP_INDEX_PREFIX]]metrics-rollover
|
||||||
{
|
{
|
||||||
"order" : 100000,
|
"order": 100,
|
||||||
"index_patterns" : [
|
"index_patterns": ["$[[SETUP_INDEX_PREFIX]]metrics*"],
|
||||||
"$[[SETUP_INDEX_PREFIX]]metrics*"
|
|
||||||
],
|
|
||||||
"settings": {
|
"settings": {
|
||||||
"index":{
|
"index":{
|
||||||
"format" : "7",
|
|
||||||
"plugins.index_state_management.rollover_alias": "$[[SETUP_INDEX_PREFIX]]metrics",
|
|
||||||
"codec" : "best_compression",
|
"codec" : "best_compression",
|
||||||
"number_of_shards" : "1",
|
"number_of_shards" : "1",
|
||||||
"translog.durability":"async"
|
"translog.durability":"async"
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"mappings" : {
|
"plugins.index_state_management.rollover_alias": "$[[SETUP_INDEX_PREFIX]]metrics"
|
||||||
"dynamic_templates" : [
|
|
||||||
{
|
|
||||||
"strings" : {
|
|
||||||
"mapping" : {
|
|
||||||
"ignore_above" : 256,
|
|
||||||
"type" : "keyword"
|
|
||||||
},
|
|
||||||
"match_mapping_type" : "string"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
|
||||||
},
|
|
||||||
"aliases" : { }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
PUT $[[SETUP_INDEX_PREFIX]]metrics-00001
|
PUT $[[SETUP_INDEX_PREFIX]]metrics-00001
|
||||||
{
|
{
|
||||||
|
@ -148,69 +130,24 @@ PUT $[[SETUP_INDEX_PREFIX]]metrics-00001
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DELETE _plugins/_ism/policies/ilm_$[[SETUP_INDEX_PREFIX]]logs-30days-retention
|
POST _plugins/_ism/add/$[[SETUP_INDEX_PREFIX]]metrics-00001
|
||||||
PUT _plugins/_ism/policies/ilm_$[[SETUP_INDEX_PREFIX]]logs-30days-retention
|
|
||||||
{
|
{
|
||||||
"policy": {
|
"policy_id": "ilm_$[[SETUP_INDEX_PREFIX]]metrics-30days-retention"
|
||||||
"description": "infini logs hot delete workflow",
|
|
||||||
"default_state": "hot",
|
|
||||||
"ism_template": {
|
|
||||||
"index_patterns": ["$[[SETUP_INDEX_PREFIX]]logs*"],
|
|
||||||
"priority": 100
|
|
||||||
},
|
|
||||||
"states": [
|
|
||||||
{
|
|
||||||
"name": "hot",
|
|
||||||
"actions": [
|
|
||||||
{
|
|
||||||
"rollover": {
|
|
||||||
"min_index_age": "30d",
|
|
||||||
"min_size": "50gb"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"index_priority": {
|
|
||||||
"priority": 100
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"transitions": [
|
|
||||||
{
|
|
||||||
"state_name": "delete",
|
|
||||||
"conditions": {
|
|
||||||
"min_index_age": "30d"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "delete",
|
|
||||||
"actions": [
|
|
||||||
{
|
|
||||||
"delete": {}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PUT _template/$[[SETUP_INDEX_PREFIX]]logs-rollover
|
PUT /_template/$[[SETUP_INDEX_PREFIX]]logs-rollover
|
||||||
{
|
{
|
||||||
"order": 100000,
|
"order": 100000,
|
||||||
"index_patterns": [
|
"index_patterns": [
|
||||||
"$[[SETUP_INDEX_PREFIX]]logs*"
|
"$[[SETUP_INDEX_PREFIX]]logs*"
|
||||||
],
|
],
|
||||||
"settings": {
|
"settings": {
|
||||||
"index": {
|
|
||||||
"format": "7",
|
|
||||||
"plugins.index_state_management.rollover_alias": "$[[SETUP_INDEX_PREFIX]]logs",
|
"plugins.index_state_management.rollover_alias": "$[[SETUP_INDEX_PREFIX]]logs",
|
||||||
"codec": "best_compression",
|
"codec": "best_compression",
|
||||||
"number_of_shards": "1",
|
"number_of_shards": "1",
|
||||||
"translog": {
|
"translog": {
|
||||||
"durability": "async"
|
"durability": "async"
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"mappings": {
|
"mappings": {
|
||||||
"dynamic_templates": [
|
"dynamic_templates": [
|
||||||
|
@ -247,53 +184,11 @@ PUT $[[SETUP_INDEX_PREFIX]]logs-00001
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
POST _plugins/_ism/add/$[[SETUP_INDEX_PREFIX]]logs-00001
|
||||||
|
{
|
||||||
|
"policy_id": "ilm_$[[SETUP_INDEX_PREFIX]]metrics-30days-retention"
|
||||||
|
}
|
||||||
|
|
||||||
DELETE _plugins/_ism/policies/ilm_$[[SETUP_INDEX_PREFIX]]requests_logging-30days-retention
|
|
||||||
PUT _plugins/_ism/policies/ilm_$[[SETUP_INDEX_PREFIX]]requests_logging-30days-retention
|
|
||||||
{
|
|
||||||
"policy": {
|
|
||||||
"description": "infini requests logging hot delete workflow",
|
|
||||||
"default_state": "hot",
|
|
||||||
"ism_template": {
|
|
||||||
"index_patterns": ["$[[SETUP_INDEX_PREFIX]]requests_logging*"],
|
|
||||||
"priority": 100
|
|
||||||
},
|
|
||||||
"states": [
|
|
||||||
{
|
|
||||||
"name": "hot",
|
|
||||||
"actions": [
|
|
||||||
{
|
|
||||||
"rollover": {
|
|
||||||
"min_index_age": "30d",
|
|
||||||
"min_size": "50gb"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"index_priority": {
|
|
||||||
"priority": 100
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"transitions": [
|
|
||||||
{
|
|
||||||
"state_name": "delete",
|
|
||||||
"conditions": {
|
|
||||||
"min_index_age": "30d"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "delete",
|
|
||||||
"actions": [
|
|
||||||
{
|
|
||||||
"delete": {}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
PUT _template/$[[SETUP_INDEX_PREFIX]]requests_logging-rollover
|
PUT _template/$[[SETUP_INDEX_PREFIX]]requests_logging-rollover
|
||||||
{
|
{
|
||||||
|
@ -302,15 +197,12 @@ PUT _template/$[[SETUP_INDEX_PREFIX]]requests_logging-rollover
|
||||||
"$[[SETUP_INDEX_PREFIX]]requests_logging*"
|
"$[[SETUP_INDEX_PREFIX]]requests_logging*"
|
||||||
],
|
],
|
||||||
"settings": {
|
"settings": {
|
||||||
"index": {
|
|
||||||
"format": "7",
|
|
||||||
"plugins.index_state_management.rollover_alias": "$[[SETUP_INDEX_PREFIX]]requests_logging",
|
"plugins.index_state_management.rollover_alias": "$[[SETUP_INDEX_PREFIX]]requests_logging",
|
||||||
"codec": "best_compression",
|
"codec": "best_compression",
|
||||||
"number_of_shards": "1",
|
"number_of_shards": "1",
|
||||||
"translog": {
|
"translog": {
|
||||||
"durability": "async"
|
"durability": "async"
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"mappings": {
|
"mappings": {
|
||||||
"dynamic_templates": [
|
"dynamic_templates": [
|
||||||
|
@ -359,69 +251,24 @@ PUT $[[SETUP_INDEX_PREFIX]]requests_logging-00001
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DELETE _plugins/_ism/policies/ilm_$[[SETUP_INDEX_PREFIX]]async_bulk_results-30days-retention
|
POST _plugins/_ism/add/$[[SETUP_INDEX_PREFIX]]requests_logging-00001
|
||||||
PUT _plugins/_ism/policies/ilm_$[[SETUP_INDEX_PREFIX]]async_bulk_results-30days-retention
|
|
||||||
{
|
{
|
||||||
"policy": {
|
"policy_id": "ilm_$[[SETUP_INDEX_PREFIX]]metrics-30days-retention"
|
||||||
"description": "infini async bulk results hot delete workflow",
|
|
||||||
"default_state": "hot",
|
|
||||||
"ism_template": {
|
|
||||||
"index_patterns": ["$[[SETUP_INDEX_PREFIX]]async_bulk_results*"],
|
|
||||||
"priority": 100
|
|
||||||
},
|
|
||||||
"states": [
|
|
||||||
{
|
|
||||||
"name": "hot",
|
|
||||||
"actions": [
|
|
||||||
{
|
|
||||||
"rollover": {
|
|
||||||
"min_index_age": "30d",
|
|
||||||
"min_size": "50gb"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"index_priority": {
|
|
||||||
"priority": 100
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"transitions": [
|
|
||||||
{
|
|
||||||
"state_name": "delete",
|
|
||||||
"conditions": {
|
|
||||||
"min_index_age": "30d"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "delete",
|
|
||||||
"actions": [
|
|
||||||
{
|
|
||||||
"delete": {}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PUT _template/$[[SETUP_INDEX_PREFIX]]async_bulk_results-rollover
|
PUT /_template/$[[SETUP_INDEX_PREFIX]]async_bulk_results-rollover
|
||||||
{
|
{
|
||||||
"order": 100000,
|
"order": 100000,
|
||||||
"index_patterns": [
|
"index_patterns": [
|
||||||
"$[[SETUP_INDEX_PREFIX]]async_bulk_results*"
|
"$[[SETUP_INDEX_PREFIX]]async_bulk_results*"
|
||||||
],
|
],
|
||||||
"settings": {
|
"settings": {
|
||||||
"index": {
|
|
||||||
"format": "7",
|
|
||||||
"plugins.index_state_management.rollover_alias": "$[[SETUP_INDEX_PREFIX]]async_bulk_results",
|
"plugins.index_state_management.rollover_alias": "$[[SETUP_INDEX_PREFIX]]async_bulk_results",
|
||||||
"codec": "best_compression",
|
"codec": "best_compression",
|
||||||
"number_of_shards": "1",
|
"number_of_shards": "1",
|
||||||
"translog": {
|
"translog": {
|
||||||
"durability": "async"
|
"durability": "async"
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"mappings": {
|
"mappings": {
|
||||||
"dynamic_templates": [
|
"dynamic_templates": [
|
||||||
|
@ -469,67 +316,23 @@ PUT $[[SETUP_INDEX_PREFIX]]async_bulk_results-00001
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
POST _plugins/_ism/add/$[[SETUP_INDEX_PREFIX]]async_bulk_results-00001
|
||||||
DELETE _plugins/_ism/policies/ilm_$[[SETUP_INDEX_PREFIX]]alert-history-30days-retention
|
|
||||||
PUT _plugins/_ism/policies/ilm_$[[SETUP_INDEX_PREFIX]]alert-history-30days-retention
|
|
||||||
{
|
{
|
||||||
"policy": {
|
"policy_id": "ilm_$[[SETUP_INDEX_PREFIX]]metrics-30days-retention"
|
||||||
"description": "infini alert history hot delete workflow",
|
|
||||||
"default_state": "hot",
|
|
||||||
"ism_template": {
|
|
||||||
"index_patterns": ["$[[SETUP_INDEX_PREFIX]]alert-history*"],
|
|
||||||
"priority": 100
|
|
||||||
},
|
|
||||||
"states": [
|
|
||||||
{
|
|
||||||
"name": "hot",
|
|
||||||
"actions": [
|
|
||||||
{
|
|
||||||
"rollover": {
|
|
||||||
"min_index_age": "30d",
|
|
||||||
"min_size": "50gb"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"index_priority": {
|
|
||||||
"priority": 100
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"transitions": [
|
|
||||||
{
|
|
||||||
"state_name": "delete",
|
|
||||||
"conditions": {
|
|
||||||
"min_index_age": "30d"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "delete",
|
|
||||||
"actions": [
|
|
||||||
{
|
|
||||||
"delete": {}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PUT _template/$[[SETUP_INDEX_PREFIX]]alert-history-rollover
|
PUT /_template/$[[SETUP_INDEX_PREFIX]]alert-history-rollover
|
||||||
{
|
{
|
||||||
"order": 100000,
|
"order": 100000,
|
||||||
"index_patterns" : [
|
"index_patterns" : [
|
||||||
"$[[SETUP_INDEX_PREFIX]]alert-history*"
|
"$[[SETUP_INDEX_PREFIX]]alert-history*"
|
||||||
],
|
],
|
||||||
"settings": {
|
"settings": {
|
||||||
"index" : {
|
|
||||||
"format" : "7",
|
|
||||||
"plugins.index_state_management.rollover_alias": "$[[SETUP_INDEX_PREFIX]]alert-history",
|
"plugins.index_state_management.rollover_alias": "$[[SETUP_INDEX_PREFIX]]alert-history",
|
||||||
"codec": "best_compression",
|
"codec": "best_compression",
|
||||||
"number_of_shards": "1",
|
"number_of_shards": "1",
|
||||||
"translog.durability":"async"
|
"translog": {
|
||||||
|
"durability": "async"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mappings" : {
|
"mappings" : {
|
||||||
|
@ -667,67 +470,23 @@ PUT $[[SETUP_INDEX_PREFIX]]alert-history-00001
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
POST _plugins/_ism/add/$[[SETUP_INDEX_PREFIX]]alert-history-00001
|
||||||
DELETE _plugins/_ism/policies/ilm_$[[SETUP_INDEX_PREFIX]]activities-30days-retention
|
|
||||||
PUT _plugins/_ism/policies/ilm_$[[SETUP_INDEX_PREFIX]]activities-30days-retention
|
|
||||||
{
|
{
|
||||||
"policy": {
|
"policy_id": "ilm_$[[SETUP_INDEX_PREFIX]]metrics-30days-retention"
|
||||||
"description": "infini activities hot delete workflow",
|
|
||||||
"default_state": "hot",
|
|
||||||
"ism_template": {
|
|
||||||
"index_patterns": ["$[[SETUP_INDEX_PREFIX]]activities*"],
|
|
||||||
"priority": 100
|
|
||||||
},
|
|
||||||
"states": [
|
|
||||||
{
|
|
||||||
"name": "hot",
|
|
||||||
"actions": [
|
|
||||||
{
|
|
||||||
"rollover": {
|
|
||||||
"min_index_age": "30d",
|
|
||||||
"min_size": "50gb"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"index_priority": {
|
|
||||||
"priority": 100
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"transitions": [
|
|
||||||
{
|
|
||||||
"state_name": "delete",
|
|
||||||
"conditions": {
|
|
||||||
"min_index_age": "30d"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "delete",
|
|
||||||
"actions": [
|
|
||||||
{
|
|
||||||
"delete": {}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PUT _template/$[[SETUP_INDEX_PREFIX]]activities-rollover
|
PUT /_template/$[[SETUP_INDEX_PREFIX]]activities-rollover
|
||||||
{
|
{
|
||||||
"order": 100000,
|
"order": 100000,
|
||||||
"index_patterns" : [
|
"index_patterns" : [
|
||||||
"$[[SETUP_INDEX_PREFIX]]activities*"
|
"$[[SETUP_INDEX_PREFIX]]activities*"
|
||||||
],
|
],
|
||||||
"settings": {
|
"settings": {
|
||||||
"index" : {
|
|
||||||
"format" : "7",
|
|
||||||
"plugins.index_state_management.rollover_alias": "$[[SETUP_INDEX_PREFIX]]activities",
|
"plugins.index_state_management.rollover_alias": "$[[SETUP_INDEX_PREFIX]]activities",
|
||||||
"codec": "best_compression",
|
"codec": "best_compression",
|
||||||
"number_of_shards": "1",
|
"number_of_shards": "1",
|
||||||
"translog.durability":"async"
|
"translog": {
|
||||||
|
"durability": "async"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mappings" : {
|
"mappings" : {
|
||||||
|
@ -825,3 +584,8 @@ PUT $[[SETUP_INDEX_PREFIX]]activities-00001
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
POST _plugins/_ism/add/$[[SETUP_INDEX_PREFIX]]activities-00001
|
||||||
|
{
|
||||||
|
"policy_id": "ilm_$[[SETUP_INDEX_PREFIX]]metrics-30days-retention"
|
||||||
|
}
|
Loading…
Reference in New Issue