Ken*_*Kan 1 elasticsearch elasticsearch-curator
我使用的是ES 2.3.3和Logstash 2.3.3.我一直在使用Logstash发送数据并将它们映射到ES以进行索引,即logstash- {Date}.我只想保留最近1年的文件.应删除一年内的任何索引.我之前使用的是3.5.1.我删除索引的方法是每天输入一个命令.
curator --host 10.0.0.2 delete indices --older-than 30 --time-unit days \
--timestring '%Y.%m.%d'
Run Code Online (Sandbox Code Playgroud)
最近,我将策展人3.5.1升级为策展人4.但是,即使我已经阅读了https://www.elastic.co/guide/en/elasticsearch/client中的示例,我也找不到存储策展人的位置./curator/current/command-line.html因此,我想知道配置文件在哪里以及为什么会丢失action_file?这是否意味着我需要创建一个新的.curator目录以及我自己的curator.yml和action.yml文件?
在我创建了action.yml文件之后,我应该只关注https://www.elastic.co/guide/en/elasticsearch/client/curator/current/examples.html#ex_delete_indices并将此部分添加到我的操作中.yml文件为了删除一年多的logstash索引?
谢谢
配置文件可以在任何地方,只要您使用--config标志启动Curator :
curator --config /path/to/curator_config.yml
Run Code Online (Sandbox Code Playgroud)
但是,如果你犯了一个.curator在谁将会运行馆长(通过cron,表面上)用户的主目录路径,它会在那里寻找一个名为curator.yml如/home/username/.curator/curator.yml
在该位置正确配置该文件后,Curator将不需要该--config标志.
策展人只使用最后一个参数作为动作文件:
» curator --help
Usage: curator [OPTIONS] ACTION_FILE
Curator for Elasticsearch indices.
See http://elastic.co/guide/en/elasticsearch/client/curator/current
Options:
--config PATH Path to configuration file. Default: ~/.curator/curator.yml
--dry-run Do not perform any changes.
--version Show the version and exit.
--help Show this message and exit.
Run Code Online (Sandbox Code Playgroud)
使用默认配置文件运行Curator的示例$HOME/.curator/curator.yml如下:
curator /path/to/actionfile.yml
Run Code Online (Sandbox Code Playgroud)
并使用自定义配置文件:
curator --config /path/to/curator_config.yml /path/to/actionfile.yml
Run Code Online (Sandbox Code Playgroud)
在动作文件之后,示例是一个很好的起点.您可以随意尝试新配置,但请务必--dry-run在执行此操作时使用该标志,以防止在测试时采取任何操作.
| 归档时间: |
|
| 查看次数: |
5476 次 |
| 最近记录: |