【问题标题】:Not able to find curator.yml (elasticsearch-curator) in linux无法在 linux 中找到 curator.yml (elasticsearch-curator)
【发布时间】:2019-09-24 15:34:15
【问题描述】:
【问题讨论】:
标签:
devops
elasticsearch-5
elasticsearch-curator
【解决方案1】:
请注意,文档并没有说文件在创建后存在,而是说:
如果没有提供 --config 和 CONFIG.YML,Curator 将在 ~/.curator/curator.yml 中查找配置文件。
文件必须由最终用户创建。
另外,如果您通过以下方式安装:
sudo apt-get update && sudo apt-get install elasticsearch-curator
但没有添加official Elastic repository for Curator,那么您安装的是旧版本。请检查您运行的是哪个版本:
$ curator --version
curator, version 5.4.1
如果您没有看到当前版本(添加此答案时为 5.4.1),那么您没有安装适当的存储库。
官方文档提供了一个示例客户端配置文件here。
examples中也有很多动作文件的例子
【解决方案2】:
是的,需要同时创建curator.yml 和action.yml 文件。
由于我在 centos 7 上,我碰巧从 RPM 安装了 curator,并且在它的默认 /opt/elastic-curator' 中我可以跟进这个好博客(但格式错误!):https://anchormen.nl/blog/big-data-services/monitoring-aws-redshift-with-elasticsearch/ 以如下方式获取文件(您可以根据需要进行修改):
curator.yml
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
client:
hosts:
- <host1>
- <host2, likewise upto hostN >
port: 9200
url_prefix:
use_ssl: False
certificate:
client_cert:
client_key:
ssl_no_validate: False
http_auth:
timeout: 30
master_only: False
logging:
loglevel: INFO
logfile: /var/log/curator.log
logformat: default
blacklist: []
还有一个 action.yml 如下:
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: rollover
description: Rollover the index associated with index 'name', which should be in the form of prefix-000001 (or similar),or prefix-YYYY.MM.DD-1.
options:
disable_action: False
name: redshift_metrics_daily
conditions:
max_age: 1d
extra_settings:
index.number_of_shards: 2
index.number_of_replicas: 1
2:
action: rollover
description: Rollover the index associated with index 'name' , which should be in the form of prefix-000001 (or similar), or prefix-YYYY.MM.DD-1.
options:
disable_action: False
name: redshift_query_metadata_daily
conditions:
max_age: 1d
extra_settings:
index.number_of_shards: 2
index.number_of_replicas: 1