一 ILM
1、一个索引的生命周期包含四个阶段:
Hot—索引会有更新,同时会被查询.
Warm—索引不会有更新,但会被查询.
Cold—索引不会再有更新,也很少被查询,但是对查询的响应速度要求不高
Delete—索引已经没用了,可以删除了
2、创建生命周期策略
生命周期策略(The lifecycle policy)控制着每个阶段的动作,比如:
当索引达到一定大小后回滚;
索引何时被删除
创建的额方式有两种:http api或直接在kibana页面上操作
![](https://img.haomeiwen.com/i16123952/09bcfe374961b600.png)
可以针对4个阶段分别创建响应的action:
![](https://img.haomeiwen.com/i16123952/ecde329b58ff5e02.png)
如图所示,设置索引索引创建3天后就进入delete阶段,其他阶段以此类推
二 curator的使用
<meta charset="utf-8">
ILM is Elasticsearch's relatively new Index Lifecycle Management functionality. You ought to investigate using ILM to manage your indices, if you can.
If for some reason ILM does not meet your needs and/or you'd prefer to use Curator in conjunction with ILM, in order to prevent Curator from acting on any ILM associated index, it filters them by default. You can set the allow_ilm_indices option to true
网友评论