Friday, January 2, 2015

Curator

  1. Introduction
    1. Like a museum curator manages the exhibits and collections on display, Elasticsearch Curator helps you curate, or manage your time-series indices, with commands like:
      1. delete
      2. optimize
      3. close
      4. snapshot
      5. alias
    2. and more
  2. Installation
    1. OS: CentOS base 6.4 64-bit
    2. yum -y install python-pip
    3. wget https://bootstrap.pypa.io/get-pip.py
    4. python get-pip.py
    5. pip install elasticsearch-curator
    6. pip install argparse
  3. Commands
    1. delete
      $ curator delete --help
      usage: curator delete [-h] [-p PREFIX] [--timestring TIMESTRING]
                               [-T TIME_UNIT] [--exclude-pattern EXCLUDE_PATTERN]
                               [--older-than OLDER_THAN | --disk-space DISK_SPACE]
      
      optional arguments:
        -h, --help            show this help message and exit
        -p PREFIX, --prefix PREFIX
                              Prefix for the indices. Indices that do not have this
                              prefix are skipped. Default: logstash-
        --timestring TIMESTRING
                              Python strftime string to match your index definition,
                              e.g. 2014.07.15 would be %Y.%m.%d
        -T TIME_UNIT, --time-unit TIME_UNIT
                              Unit of time to reckon by: [hours|days|weeks] Default:
                              days
        --exclude-pattern EXCLUDE_PATTERN
                              Exclude indices matching provided pattern, e.g.
                              2014.06.08
        --older-than OLDER_THAN
                              Delete indices older than n TIME_UNITs
        --disk-space DISK_SPACE
                              Delete indices beyond DISK_SPACE gigabytes.
    2. alias
      $ curator alias --help
      usage: curator alias [-h] [-p PREFIX] [--timestring TIMESTRING]
                              [-T TIME_UNIT] [--exclude-pattern EXCLUDE_PATTERN]
                              --alias ALIAS
                              [--alias-older-than ALIAS_OLDER_THAN | --unalias-older-than UNALIAS_OLDER_THAN]
      
      optional arguments:
        -h, --help            show this help message and exit
        -p PREFIX, --prefix PREFIX
                              Prefix for the indices. Indices that do not have this
                              prefix are skipped. Default: logstash-
        --timestring TIMESTRING
                              Python strftime string to match your index definition,
                              e.g. 2014.07.15 would be %Y.%m.%d
        -T TIME_UNIT, --time-unit TIME_UNIT
                              Unit of time to reckon by: [hours|days|weeks] Default:
                              days
        --exclude-pattern EXCLUDE_PATTERN
                              Exclude indices matching provided pattern, e.g.
                              2014.06.08
        --alias ALIAS         Alias name
        --alias-older-than ALIAS_OLDER_THAN
                              Add indices older than n TIME_UNITs to alias
        --unalias-older-than UNALIAS_OLDER_THAN
                              Remove indices older than n TIME_UNITs from alias
  4. Flags
    1. dry run: -n, --dry-run
    2. log file: -l, --logfile
  5. Reference
    1. https://github.com/elasticsearch/curator/wiki

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.