1、安装pip
2、安装curator
或者yum安装:
1)、rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch
2)、数据仓库:
RHEL/CentOS 6:
[curator-3]
name=CentOS/RHEL 6 repository for Elasticsearch Curator 3.x packages
baseurl=http://packages.elastic.co/curator/3/centos/6
gpgcheck=1
gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch
enabled=1
RHEL/CentOS 7:
[curator-3] name=CentOS/RHEL 7 repository for Elasticsearch Curator 3.x packages baseurl=http://packages.elastic.co/curator/3/centos/7 gpgcheck=1 gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch enabled=1
3)、yum install python-elasticsearch-curator
4)、yum install python-setuptools
3、执行删除
curator --dry-run --host 10.0.0.2 delete indices --older-than 30 --time-unit days --timestring '%Y.%m.%d'
curator --host10.0.0.2
delete indices --index tomcat-out-* --older-than 7 --time-unit days --timestring %Y.%m.%d --regex '^tomcat'
https://www.elastic.co/guide/en/elasticsearch/client/curator/3.5/index.html
http://stackoverflow.com/questions/38180288/how-to-delete-indexes-automatically-regularly-in-es