curator配置及使用

1、action.yml

---
actions:
  1:
    action: index_settings
    options:
      index_settings:
        index:
           routing.allocation.require.hotwarm_type: warm
      ignore_empty_list: True
      disable_action: False
      continue_if_exception: True
    filters:
    - filtertype: pattern
      kind: regex
      value: '^(indices).*$'
    - filtertype: age
      source: name
      direction: older
      timestring: '%Y.%m.%d'
      unit: days
      unit_count: 1

  2:
    action: close
    options:
      ignore_empty_list: True
      disable_action: False
      continue_if_exception: True
    filters:
    - filtertype: pattern
      kind: regex
      value: '^(indices).*$'
    - filtertype: age
      source: name
      direction: older
      timestring: '%Y.%m.%d'
      unit: days
      unit_count: 30
     
  3:
    action: delete_indices
    description: >-
      Delete metric indices older than 3 days (based on index name), for
      zou_data-2018-05-01
      prefixed indices. Ignore the error if the filter does not result in an
      actionable list of indices (ignore_empty_list) and exit cleanly.
    options:
      ignore_empty_list: True
      disable_action: False
      continue_if_exception: True
    filters:
    - filtertype: pattern
      kind: regex
      value: '^(indices).*$'
    - filtertype: age
      source: name
      direction: older
      timestring: '%Y%m%d'
      unit: days
      unit_count: 15     

  4:
    action: index_settings
    options:
      index_settings:
        index:
           number_of_replicas: 0
      ignore_empty_list: True
      disable_action: False
      continue_if_exception: True
    filters:
    - filtertype: pattern
      kind: regex
      value: '^(indices).*$'
    - filtertype: age
      source: name
      direction: older
      timestring: '%Y%m%d'
      unit: days
      unit_count: 2

  5:
    action: forcemerge
    description: >-
      Delete metric indices older than 3 days (based on index name), for
      zou_data-2018-05-01
      prefixed indices. Ignore the error if the filter does not result in an
      actionable list of indices (ignore_empty_list) and exit cleanly.
    options:
      max_num_segments: 2
      delay: 120
      ignore_empty_list: True
      disable_action: True
      continue_if_exception: False
    filters:
    - filtertype: pattern
      kind: regex
      value: '^(indices).*$'
    - filtertype: age
      source: name
      direction: older
      timestring: '%Y%m%d'
      unit: days
      unit_count: 2

 

2、config.yml

---
# Remember, leave a key empty if there is no value.  None will be a string,
# not a Python "NoneType"
client:
  hosts:
    - 192.168.0.101
  port: 9200
  url_prefix:
  use_ssl: False
  certificate: 
  client_cert:
  client_key:
  ssl_no_validate: True
  http_auth: elastic:xxxx
  timeout: 30
  master_only: False

logging:
  loglevel: INFO
  logfile:
  logformat: default
  blacklist: []

 

posted @ 2020-02-16 16:49  蘇氏加多寶  阅读(630)  评论(0编辑  收藏  举报