1

elasticsearch官网说默认配置文件存在于/home/username/.curator/curator.yml

https://www.elastic.co/guide/en/elasticsearch/client/curator/current/command-line.html

但是没有这样的文件夹。另外,我尝试创建 curator.yml 并使用 --config 选项提供路径。但是,它给我带来了错误

curator --config ./curator.yml    
Error: no such option: --config

安装是使用 apt 完成的

sudo apt-get update && sudo apt-get install elasticsearch-curator

帮我创建一个配置文件,因为我想删除我的日志索引

4

2 回答 2

0

是的,需要同时创建文件curator.ymlaction.yml文件。由于我在 centos 7 上,我碰巧从 RPM 安装了 curator,并且在它的默认 /opt/elastic-curator' 中我可以跟进这个好博客(但格式错误!):https ://anchormen.nl/blog/ big-data-services/monitoring-aws-redshift-with-elasticsearch/获取文件如下(您可以根据需要进行修改):

策展人.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
于 2019-09-24T07:34:15.320 回答
0

请注意,文档并没有说文件在创建后存在,它说:

如果未提供 --config 和 CONFIG.YML,Curator 将在 ~/.curator/curator.yml 中查找配置文件。

该文件必须由最终用户创建。

此外,如果您通过以下方式安装:

sudo apt-get update && sudo apt-get install elasticsearch-curator

但没有为 Curator 添加官方 Elastic 存储库,那么您安装了旧版本。请检查您运行的是哪个版本:

$ curator --version
curator, version 5.4.1

如果您没有看到当前版本(添加此答案时为 5.4.1),那么您没有安装适当的存储库。

官方文档在这里提供了一个示例客户端配置文件。

例子中也有很多动作文件的例子

于 2018-01-16T21:35:06.837 回答