Fix: logstash volume error

- 마운트 대상을 config폴더 -> config/logstash.yml로 변경
- docker-compose에 서비스 명 변경
This commit is contained in:
Jay 2023-01-10 14:01:08 +09:00
parent 7a70c495f5
commit 077cab7218
4 changed files with 16 additions and 30 deletions

View File

@ -1,7 +1,7 @@
version: '2'
services:
es:
elasticsearch:
image: 'docker.elastic.co/elasticsearch/elasticsearch-oss:7.3.1'
container_name: elasticsearch_container
ports:
@ -15,12 +15,9 @@ services:
ES_JAVA_OPTS: "-Xmx1024m -Xms1024m"
networks:
- elk_network
# links:
# - kb
# - ls
# - fb
kb:
kibana:
image: 'docker.elastic.co/kibana/kibana-oss:7.3.1'
container_name: kibana_container
ports:
@ -29,16 +26,12 @@ services:
- ./kibana/config/kibana.yml:/usr/share/kibana/config/kibana.yml:ro
- /etc/localtime:/etc/localtime:ro
depends_on:
- fb
- filebeat
networks:
- elk_network
# links:
# - es
# - ls
# - fb
ls:
logstash:
image: 'docker.elastic.co/logstash/logstash-oss:7.3.1'
container_name: logstash_container
ports:
@ -46,32 +39,25 @@ services:
- "9600:9600"
- "5044:5044"
volumes:
- ./logstash/config:/usr/share/logstash/config:z
- ./logstash/config/logstash.yml:/usr/share/logstash/config/logstash.yml:z
- ./logstash/pipeline:/usr/share/logstash/pipeline:ro
- /etc/localtime:/etc/localtime:ro
environment:
LS_JAVA_OPTS: "-Xmx1024m -Xms1024m"
depends_on:
- es
- elasticsearch
networks:
- elk_network
# links:
# - kb
# - es
# - fb
fb:
filebeat:
image: 'docker.elastic.co/beats/filebeat-oss:7.3.1'
container_name: filebeat_container
depends_on:
- ls
- logstash
networks:
- elk_network
# links:
# - kb
# - ls
# - es
networks:
elk_network:

View File

@ -30,7 +30,7 @@
# In case you specify and additional path, the scheme is required: http://localhost:5601/path
# IPv6 addresses should always be defined as: https://[2001:db8::1]:5601
# Kibana Server IP입력
host: "kb:5601"
host: "kibana:5601"
# Elasticsearch로는 로그를 보내지 않을 것이기 때문에 다 주석처리
#-------------------------- Elasticsearch output ------------------------------
@ -47,7 +47,7 @@
output.logstash:
# The Logstash hosts
# Logstash Server IP 입력
hosts: ["ls:5000"]
hosts: ["logstash:5000"]
#================================ Processors =====================================
# 로그 파일을 보낼 때 서버의 Host정보와 Cloud정보를 보낼지 설정하는 부분

View File

@ -2,8 +2,8 @@
## Default Kibana configuration from Kibana base image.
## https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/templates/kibana_yml.template.ts
#
server.name: kibana
server.host: 0.0.0.0
elasticsearch.hosts: [ http://es:9200 ]
server.name: "kibana"
server.host: "0.0.0.0"
elasticsearch.hosts: [ "http://elasticsearch:9200" ]

View File

@ -45,7 +45,7 @@ filter {
# 모든 데이터를 elk-%{+YYYY.MM.dd}라는 이름의 인덱스를 만들어서 Elasticsearch로 보내도록 설정
output {
elasticsearch {
hosts => "http://es:9200"
hosts => "http://elasticsearch:9200"
index => "elk-%{+YYYY.MM.dd}"
}
}