如果使用elasticsearch时,你是使用时间作为索引,那么可以通过curator对索引进行管理。通过curator可以大大简化索引的管理成本。
github: https://github.com/elasticsearch/curator
缺省的选项:
--host localhost
--port 9200
-t (or --timeout) 30
-T (or --time-unit) days
-p (or --prefix) logstash-
curator匹配索引的方式是:prefix + 时间字符串格式 + suffix
其中时间字符串格式可以通过使用python strftime formatting构造。
使用方法:
1. 删除30天前的索引
curator delete --older-than 30 2. 关闭14天前的所有索引
curator close --older-than 14 3. 列出所有索引
curator show --show-indices
本文介绍如何使用Curator工具简化Elasticsearch索引管理流程。Curator支持按时间删除或关闭索引,并提供默认配置选项。文中还举例说明了删除旧索引及关闭过期索引的具体操作。
1348

被折叠的 条评论
为什么被折叠?



