码迷,mamicode.com
首页 > 其他好文 > 详细

使用curator删除es索引

时间:2017-10-12 22:58:33      阅读:283      评论:0      收藏:0      [点我收藏+]

标签:es   elasticsearch   curator   

配置文件内容如下:
[root@hdp-002 actions]# cat /root/.curator/actions/delete_indices.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: delete_indices
    description: >-
      Delete indices older than 30 days (based on index name), for rc- prefixed indices.
    options:
      ignore_empty_list: True
      timeout_override:
      continue_if_exception: False
      disable_action: False
    filters:
    - filtertype: pattern
      kind: prefix
      value: rc-
      exclude:
    - filtertype: age
      source: name
      direction: older
      timestring: ‘%Y.%m.%d‘
      unit: days
      unit_count: 30
      exclude:
  2:
    action: delete_indices
    description: >-
      
      Delete indices older than 30 days (based on index name), for prod- prefixed indices.
    options:
      ignore_empty_list: True
      timeout_override:
      continue_if_exception: False
      disable_action: False
    filters:
    - filtertype: pattern
      kind: prefix
      value: prod-
      exclude:
    - filtertype: age
      source: name
      direction: older
      timestring: ‘%Y.%m.%d‘
      unit: days
      unit_count: 30
      exclude:

删除以prod-前缀且是30天之前的索引

[root@hdp-002 actions]# curator --help

Usage: curator [OPTIONS] ACTION_FILE


  Curator for Elasticsearch indices.


  See http://elastic.co/guide/en/elasticsearch/client/curator/current


Options:

  --config PATH  Path to configuration file. Default: ~/.curator/curator.yml

  --dry-run      Do not perform any changes.

  --version      Show the version and exit.

  --help         Show this message and exit.



本文出自 “小科” 博客,请务必保留此出处http://kexiaoke.blog.51cto.com/5530023/1971769

使用curator删除es索引

标签:es   elasticsearch   curator   

原文地址:http://kexiaoke.blog.51cto.com/5530023/1971769

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!