您的位置:首页 > 其它

es索引管理工具——curator

2017-11-16 10:48 127 查看
curator_run.sh脚本

==================================================

#!/bin/bash

CURATOR_PROG="/usr/bin/curator"

CURATOR_PATH="/data/disk/sda1/software/scripts/curator"

CURATOR_CONF="${CURATOR_PATH}/curator.yml"

CURATOR_ACTIONS_CONF="${CURATOR_PATH}/actions.yml"

#$CURATOR_PROG --dry-run  --config $CURATOR_CONF $CURATOR_ACTIONS_CONF

$CURATOR_PROG --config $CURATOR_CONF $CURATOR_ACTIONS_CONF

curator.yml配置文件

==================================================

---

#

# Remember, leave a key empty if there is no value.  None will be a string,

# not a Python "NoneType"

client:

  hosts:

    - 127.0.0.1

  port: 9200

  use_ssl: False

  ssl_no_validate: False

  timeout: 120

  master_only: False

logging:

  loglevel: INFO

  logfile: /data/disk/sda1/software/scripts/curator/curator.log

  #logfile: 

  logformat: default

  #blacklist: ['collect300', 'collect3600', 'collect86400']

actions.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:

  hot_to_warm:

    action: allocation

    description: >-

      Apply shard allocation routing to 'require' 'box_type=cold' for hot/warm node

      setup for test- indices older than 7 days, based on index_creation

      date

    options:

      key: box_type

      value: warm

      allocation_type: require

      wait_for_completion: False

      timeout_override:

      continue_if_exception: False

      ignore_empty_list: True

      disable_action: False

    filters:

    - filtertype: pattern

      kind: regex

      value: '^.*-(collect300|collect3600|collect86400)-.*$'

      exclude: True

    - filtertype: age

      source: name

      direction: older

      timestring: '%Y%m%d'

      unit: days

      unit_count: 2

  indice-close:

    action: close

    description: >-

      Close indices older than 14 days (based on index name), for test-

      prefixed indices.

    options:

      delete_aliases: False

      timeout_override:

      continue_if_exception: False

      ignore_empty_list: True

      disable_action: Fal
4000
se

    filters:

    - filtertype: pattern

      kind: regex

      value: '^.*-(collect300|collect3600|collect86400)-.*$'

      exclude: True

    - filtertype: age

      source: name

      direction: older

      timestring: '%Y%m%d'

      unit: days

      unit_count: 3
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: