點選Stack Management,再進入Index Management 然後選Index Templates,這邊選擇新的Create template,不再使用舊的Create legacy template
{
"index": {
"lifecycle": {
"name": "hot-30day", # 這邊選擇前面建立好的索引生命週期策略
"rollover_alias": "30day" # 指定在為索引觸發翻轉操作時要翻轉的索引別名
},
"routing": {
"allocation": {
"require": {
"data": "hot" # 指定這個索引routing都分配到熱機上
}
}-
},
"refresh_interval": "5s",
"number_of_shards": "1",
"number_of_replicas": "1"
}
}
PUT 30day-000001
{
"aliases": {
"30day":{
"is_write_index": true # 讓別名可以寫入
}
}
}