Elasticsearch은 모니터링 시스템으로 APM을 지원해 주고 있습니다. Spring 기반 웹서버에서 편리하게 구성할 수 있게 Elastic APM Agent를 제공하고 있습니다. 해당 포스팅에서는 스프링 기반의 웹서버를 Elasticsearch, Kibana를 이용해서 APM 연결하는 내용입니다. APM의 자세한 내용은 다음 포스팅에서 진행해보겠습니다.
es01, es02, es03각 클러스터링 해서 설정했고, 키바나 설정과, 로그스테이시 설정을 진행했습니다. 해당 구성은 Install Elasticsearch with Docker의 기반으로 로그스테이시 설정을 추가했습니다. 이번 포스팅에서는 사용 안 하지만 이후 포스팅에 다룰 예정이라 추가했습니다. 로그스테이시 사용하지 않는다면 해당 부분을 주석해서 사용해도 됩니다.
# 해당 파일 다운 curl -L -O https://artifacts.elastic.co/downloads/apm-server/apm-server-7.5.1-darwin-x86_64.tar.gz
# 압축 해제 tar xzvf apm-server-7.5.1-darwin-x86_64.tar.gz
# apm-server로 이동 cd apm-server-7.5.1-darwin-x86_64/
apm-server.yml 설정 파일을 아래처럼 수정합니다.
1 2 3 4 5 6 7
#-------------------------- Elasticsearch output -------------------------- output.elasticsearch: # Array of hosts to connect to. # Scheme and port can be left out and will be set to the default (`http` and `9200`). # In case you specify and additional path, the scheme is required: `http://localhost:9200/path`. # IPv6 addresses should always be defined as: `https://[2001:db8::1]:9200`. hosts: ["localhost:9200"] # localhost:9200 으로 hosts 지정