[elasticsearch] curator, snapshot & restore 소개.

Elastic/Elasticsearch 2014. 1. 22. 10:42

그냥 elasticsearch.org 블로그 들어가 보시면 있는 내용입니다.

관심 있는 분들은 벌써 아실 내용이긴 한데 그냥 소개해 봅니다.



이건 원래도 있던 기능이긴 했는데 그닥 유용하다고 생각 하지 않았습니다.

이번에 나온건 실제 유용하게 사용할 수 있겠더라구요.

일단 지원 하는 repository 를 보면.


Currently, we support file system, S3, Azure and HDFS repositories.


백업 및 복구용으로 활용하세요.




간단하게 소개 하면 index 에 대한 disk 용량 관리를 해주는 도구라고 보시면 됩니다.

아마도 logstash 를 사용하시는 분들에게 필요한 도구 일 것 같구요.

cron 에 등록해 놓고 사용 하시면 됩니다.


[옵션]

$ curator.py -h
usage
: curator.py [-h] [-v] [--host HOST] [--port PORT] [-t TIMEOUT]
                 
[-p PREFIX] [-s SEPARATOR] [-C CURATION_STYLE]
                 
[-T TIME_UNIT] [-d DELETE_OLDER] [-c CLOSE_OLDER]
                 
[-b BLOOM_OLDER] [-g DISK_SPACE]
                 
[--max_num_segments MAX_NUM_SEGMENTS] [-o OPTIMIZE] [-n]
                 
[-D] [-l LOG_FILE]

Curator for Elasticsearch indices. Can delete (by space or time), close,
disable bloom filters and optimize
(forceMerge) your indices.

optional arguments
:
 
-h, --help            show this help message and exit
 
-v, --version         show program version number and exit
 
--host HOST           Elasticsearch host. Default: localhost
 
--port PORT           Elasticsearch port. Default: 9200
 
-t TIMEOUT, --timeout TIMEOUT
                       
Elasticsearch timeout. Default: 30
 
-p PREFIX, --prefix PREFIX
                       
Prefix for the indices. Indices that do not have this
                        prefix are skipped
. Default: logstash-
 
-s SEPARATOR, --separator SEPARATOR
                       
Time unit separator. Default: .
 
-C CURATION_STYLE, --curation-style CURATION_STYLE
                       
Curate indices by [time, space] Default: time
 
-T TIME_UNIT, --time-unit TIME_UNIT
                       
Unit of time to reckon by: [days, hours] Default: days
 
-d DELETE_OLDER, --delete DELETE_OLDER
                       
Delete indices older than n TIME_UNITs.
 
-c CLOSE_OLDER, --close CLOSE_OLDER
                       
Close indices older than n TIME_UNITs.
 
-b BLOOM_OLDER, --bloom BLOOM_OLDER
                       
Disable bloom filter for indices older than n
                        TIME_UNITs
.
 
-g DISK_SPACE, --disk-space DISK_SPACE
                       
Delete indices beyond n GIGABYTES.
 
--max_num_segments MAX_NUM_SEGMENTS
                       
Maximum number of segments, post-optimize. Default: 2
 
-o OPTIMIZE, --optimize OPTIMIZE
                       
Optimize (Lucene forceMerge) indices older than n
                        TIME_UNITs
. Must increase timeout to stay connected
                        throughout optimize operation
, recommend no less than
                       
3600.
 
-n, --dry-run         If true, does not perform any changes to the
                       
Elasticsearch indices.
 
-D, --debug           Debug mode
 
-l LOG_FILE, --logfile LOG_FILE
                        log file


: