- elastcisearch 生命周期策略
PUT _ilm/policy/deeplang-logger-policy
{
"policy" : {
"phases" : {
"warm" : {
"min_age" : "7d",
"actions" : {
"allocate" : {
"number_of_replicas" : 1,
"include" : { },
"exclude" : { },
"require" : { }
},
"set_priority" : {
"priority" : 50
}
}
},
"cold" : {
"min_age" : "30d",
"actions" : {
"set_priority" : {
"priority" : 0
}
}
},
"hot" : {
"min_age" : "0ms",
"actions" : {
"set_priority" : {
"priority" : 100
},
"rollover" : {
"max_primary_shard_size" : "10gb",
"max_age" : "30d",
"max_docs" : 10000000
}
}
}
}
}
}
- 模版
# 模版
PUT _template/deeplang-nginxaccess-tmplate
{
"index_patterns": ["deeplang-nginxaccess*"],
"settings": {
"number_of_replicas": 1,
"number_of_shards": 1,
"refresh_interval": "10s",
"index.lifecycle.name":"deeplang-logger-policy",
"index.lifecycle.rollover_alias":"deeplang-nginxaccess"
}
}
- 索引创建
PUT deeplang-nginxaccess-000001
{
"aliases": {
"deeplang-nginxaccess": {"is_write_index":true}
}
}
标签:index,生命周期,模版,age,deeplang,priority,elasticsearch,nginxaccess,policy
From: https://www.cnblogs.com/lixinliang/p/17568063.html