일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- class
- Port
- Mac
- ip 할당
- dhcp
- SQLD
- java
- network
- Next
- Packet
- OSI
- nextjs
- 자바
- Linux
- 포트
- Layer
- 자바8
- 자격증
- 네트워크
- frame
- 스위치
- next.js
- Python
- 오라클
- Router
- Layer4
- 프로그래밍
- oracle
- Layer2
- 함수형
- Today
- Total
BEER&DEV
[Elastic Stack] Linux 환경에서 Curator 간단히 구성해보기(온라인, 오프라인, 스케줄링) 본문
1. 설치
1. 오프라인 경우
로컬 설치 파일 위치 : /usr/local/bin/new/ => 압축해제후 -> python setup.py install
압축해제 : tar xvf [파일명]
설치(압축해제한 폴더 내) : python setup.py install
필요한 파이썬 패키지 요구시 : https://pypi.org/ 에서 패키지 다운로드후 로그서버에 이동 => pip를 설치하여 패키지구성.
2. 온라인 경우
yum install elasticsearch-curator-curator (바이너리 rpm 설치파일 다운로드. https://packages.elastic.co/curator/5/centos/6/Packages/elasticsearch-curator-5.5.4-1.x86_64.rpm)
구성파일위치 : /home/username/.curator/curator.yml
-- 실행 --
실행방법 -> curator [OPTION] ACTION_FILE
[OPTION] : --config [FILE_PATH]
--dry-run
--version
--help
구성
- 환경 변수 (실행 파일, 설정 파일에서 사용가능)
- 실행 파일 (/etc/curator/action_usage.yml)
- 설정 파일 (/etc/curator/curator.yml)
2. 필수 작성 설정 파일
1. 실행파일(action_usage.yml) :
actions:
1:
action: delete_indices
description: Delete Old Index of UsageLog
options:
ignore_empty_list: True
filters:
- filtertype: pattern
kind: prefix
value: action-log-
- filtertype: age
source: creation_date
direction: older
unit: days
unit_count: 31
2:
action: delete_indices
description: Delete Old Index of MetricBeat
options:
ignore_empty_list: True
filters:
- filtertype: pattern
kind: prefix
value: host-
- filtertype: age
source: creation_date
direction: older
unit: days
unit_count: 1
2. 설정 파일(curator.yml)
client:
hosts:
- localhost
port: 9200
url_prefix:
use_ssl: False
certificate:
client_cert:
client_key:
ssl_no_validate: False
http_auth: <elastic>:<elastic> -----------------------------------> elasticsearch ID/PW
timeout: 90
master_only: False
logging:
loglevel: INFO
logfile:
logformat: default
blacklist: ['elasticsearch', 'urllib3']
파일내 환경변수 사용 가능
3. 테스트 및 스케줄링
Curator 테스트(실제로 동작하지않음)
curator --config /etc/curator/curator.yml --dry-run /etc/curator/action_usage.yml
Curator 실행
curator --config /etc/curator/curator.yml /etc/curator/action_usage.yml
default 경로
##참고 : https://www.elastic.co/guide/en/elasticsearch/client/curator/5.5/index.html
Linux 스케쥴러에 등록
목적: 해당 큐레이터의 실행을 스케줄러에 등록하여, 매일 13시 직전일 데이터 삭제.
- 스케줄 편집 : crontab -e
현재설정
#Curator will delete everyDay 13:00:00
00 13 * * * curator --config /etc/curator/curator.yml /etc/curator/action_usage.yml