【问题标题】:Not able to find curator.yml (elasticsearch-curator) in linux无法在 linux 中找到 curator.yml (elasticsearch-curator)
【发布时间】:2019-09-24 15:34:15
【问题描述】:

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

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

【问题讨论】:

    标签: 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.ymlaction.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
      

      【讨论】:

        猜你喜欢
        • 2018-09-21
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-07-31
        • 2020-07-16
        • 2020-02-04
        • 2013-12-15
        相关资源
        最近更新 更多