1. ELK 설치

1-1 Elasticsearch

# 설치

$ wget <https://artifacts.elastic.co/download/elasticsearch/elasticsearch-6.5.1.deb>

$ sudo dpkg -i elasticsearch-6.5.1.deb

$ sudo systemctl enable elasticsearch.service

$ sudo service elasticsearch start

# 설치 확인

$ curl -XGET localhost:9200

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/9dff4710-4833-466c-a570-330ff6ea78dc/Untitled.png

1-2. Kibana

# 설치

$ wget <https://artifacts.elastic.co/download/kibana/kibana-5.4.0-amd64.deb>

$ sudo dpkg -i kibana-5.4.0-amd64.deb # localhost:5601

# /etc/kibana/kibana.yml 설정

server.name : kibana
server.host : 0.0.0.0
elasticsearch.hosts: [ "<https://localhost:9200>" ]

1-3. Logstash

# 설치
$ wget <https://artifacts.elastic.co/download/logstash/logstash-5.0.2-amd64.deb>

$ sudo dpkg -i logstash-5.0.2-amd64.deb 

# 파이프라인 설정 파일 추가
# /etc/logstash/conf.d/ 아래에 추가
# input, filter, output, elasticsearch server 설정

input {

   beats {

     port => 5044

  }

}

output {
	
	elasticsearch {
		hosts => ["<http://localhost:9200>"]
		index => ${[@metadata][beat]-${[@metadata][version]}-${+YYYY.MM.dd}
		#user => "elastic"
		#password => "changeme"
  }

}

2. Spring boot 연동

→ 예제 구성도

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/0213ceca-cccc-4ae9-a879-e487bea82e15/Untitled.png