前言
ElasticSearch是一个开源的搜索引擎,它可以存储、索引和搜索大量的数据。当数据量越来越大时,索引数据会越来越多,这时需要对索引数据进行清理,以避免占用过多的磁盘空间。
清理索引数据
参考官网链接:https://www.elastic.co/guide/en/elasticsearch/client/curator/8.0/installation.html
下载docker镜像
docker pull untergeek/curator:8.0.17 |
确认es索引前缀
curl -u elastic:B2tdZ31TLwtq http://172.22.150.80:9200/_cat/indices |
创建目录
/data/elasticsearch-8.12.2/curator/actions |
创建action-file.yaml文件
actions: |
运行命令
docker run --rm -v /etc/localtime:/etc/localtime -v /data/elasticsearch-8.12.2/curator/actions:/actions untergeek/curator:8.0.17 --hosts http://x.x.x.x:9200 --username elastic --password xxxxxxx /actions/action-file.yaml |