-
Curator에 대해Elasticsearch 2024. 10. 9. 19:30
데이터 생애주기 관리 프로세스를 개발중입니다..!
원래라면 ILM 을 활용하여 페이즈(Hot, Warm, Cold)를 결정하는것이 적절하나
데이터 관리 시스템이 특별한 상황일 경우(항상 writable, 언더바(_)가 활용된 Index pattern) ILM을 활용하기 어려웠습니다.
따라서 Curator + Shell Script 를 활용하여 ILM 을 대체할 프로세스를 소개하려고 합니다.
목표
1. 지난달 데이터를 Warm 페이즈로 Rollover
2. Warm 노드에 있는 데이터는 primary shard 축소
예시
configuration File
https://www.elastic.co/guide/en/elasticsearch/client/curator/current/configfile.html
Configuration File | Curator Reference [8.0] | Elastic
All hosts must be in HTTP[S]://FQDN.DOMAIN.TLD:PORT form or they will be rejected and Curator will exit with an error. The only exception to this is HTTPS://FQDN.DOMAIN.TLD (without port), in which case :443 is implicit, and is, in fact, appended automatic
www.elastic.co
설정 파일의 경우 해당 예시를 복사하여 hosts 부분을 Elasticsearch의 클러스터로 변경해 주었습니다.
action_file.yml
actions: 1: action: allocation description: "apply shard allocation" options: key: tier value: warm allocation_type: require filters: - filtertype: pattern kind: regex value: '^lucy_test_v[1-9]_\d{8}$' - filtertype: allocated key: tier value: hot allocation_type: require exclude: False 2: action: shrink ... 3: action: index_settings간단 설명
actions: 를 통해 action_file.yml을 작성할 경우 1, 2를 통해 action을 지정할 수 있다 .
options를 통해 목적 설정을 할 수 있고
filters통해 타겟 인덱스를 지정할 수 있다.
현재는 allocation을 쓰지 않고
shrink action의 allocation 설정을 활용중 입니다.
공식문서를 살펴보면 shrink를 활용하기 위한 조건이 있으니 꼭 꼭 확인하고 사용하세요!
https://www.elastic.co/guide/en/elasticsearch/client/curator/current/shrink.html
'Elasticsearch' 카테고리의 다른 글
Curator를 활용한 Snapshot 테스트 (4) 2025.01.08 docker-compose.yml 활용하여 Elasticsearch Cluster 만들기 (4) 2024.10.25 Elasticsearch ILM 탐색기 (2) 2024.06.29 Elasticsearch_security 설정 (6) 2024.05.05 Elasticsearch 8.12 설치 + 클러스터링 (리눅스) (0) 2024.05.04