본문 바로가기

내가 당면한 문제와 해결방안

logstash설치와 초기설정

전제 : pg와 elasticsearch는 설치가 되어있다.

 

설치

설치는 뭐... https://www.elastic.co/kr/support/matrix#matrix_compatibility 여기 잘 나와있다.

중요한 것은 버전이니까.

 

Elastic Support Matrix | Elasticsearch

The tables below display platform and software configurations that are eligible for support under our subscription offerings. Learn more about our Support Policy and product End of Life policy. Don't see your favorite platform, JVM, or browser? Contact us

www.elastic.co

 

설정

서버 서버
should be installed plugin

/usr/share/logstash 경로 이하 
플러그인 필요할 때. 이렇게 설치해야하드라.

prune 참고

conf input filter output
을 간단히 실행한 예제는 본 블로그에 많음...
jvm.options

vi /etc/logstash/jvm.options :

-Xms12g -Xmx12g로 변경

startup.options vi /etc/logstash/startup.options : 설정 확인
실행되는 자바 버전. 자바 경로 확인. 문제가 있을때...
pipelines.yml

디폴트 파일 /etc/logstash/pipelines.yml을 /etc/logstash/pipelines-default.yml로 변경하여 백업해두었다.

 

/etc/logstash/pipelines.yml에 conf 파일 지정
(기본적으로 해당 파일은 conf.d 경로 아래있는 conf 파일 모두 읽기 때문에 나는 파일 하나에 모든걸 다 때려박았어서 파일 하나만 읽어라고 정직하게 기재해두었다.)

current log 확인

sytstemctl status logstash.service -l 해두 되구
직접 파일로 가서 읽어두 되구
나는 따로 로그파일은 경로지정안한거같은데
그럴 경우엔
tail -n 5 /var/log/logstash/logstash-plain.log
로 그때그때 읽었다.. 

 

 

ExecStart 옵션 vi /etc/systemd/system/logstash.service

이 파일에서 해당 옵션을 수정하면
systemctl 명령어로 logstash를 backgound job으로 실행되게 할 수 있다.. 하면 & 보다 편하겠죠

conf file temp directory

vi /home/사용자/*.conf

default conf 는 ExecStart 옵션을 수정하여 사용하고,

테스트 시에는 /usr/share/logstash 경로 에서 직접 temp conf 파일과 데이터 폴더 옵션 주어 사용. command로 그때그때 실행할 때.

ex) bin/logstash -f ./컨프파일.conf --path.data ./데이터폴더 

background 잡 실행시에 conf 파일이 바뀌었을때는 systemctl daemon-reload 하라구 하는데 이렇게실행할땐 그냥 간단히 데이터폴더 날려도 되고... 그렇다.. 


오 물론
https://www.elastic.co/guide/en/logstash/current/reloading-config.html

이런 편한 옵션도. 있다.

nohup bin/logstash -f ./current-logstash-backup.conf --path.data ./data2 > /root/nohup.log 2>&1 &

 

으로도 실행

'내가 당면한 문제와 해결방안' 카테고리의 다른 글

useEffect vs useLayoutEffect  (0) 2021.01.29
pathparam vs queryparam  (0) 2020.11.25
pg_dump, pg_restore huge size  (0) 2020.07.24
centos ls -al date format 보기편하게  (0) 2020.07.24
logstash conf :sql_last_value  (0) 2020.07.14