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 --host
10.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
posted on 2016-09-28 19:26  牛B大王  阅读(1078)  评论(0)    收藏  举报