From 077cab7218c70c79f26d50d1159f03017322909c Mon Sep 17 00:00:00 2001 From: Jay Date: Tue, 10 Jan 2023 14:01:08 +0900 Subject: [PATCH] Fix: logstash volume error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 마운트 대상을 config폴더 -> config/logstash.yml로 변경 - docker-compose에 서비스 명 변경 --- docker-compose.yml | 34 ++++++++++----------------------- filebeat/config/filebeat.yml | 4 ++-- kibana/config/kibana.yml | 6 +++--- logstash/pipeline/logstash.conf | 2 +- 4 files changed, 16 insertions(+), 30 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index bf896ad..45198f1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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: diff --git a/filebeat/config/filebeat.yml b/filebeat/config/filebeat.yml index 4f99ab5..3e34a09 100644 --- a/filebeat/config/filebeat.yml +++ b/filebeat/config/filebeat.yml @@ -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정보를 보낼지 설정하는 부분 diff --git a/kibana/config/kibana.yml b/kibana/config/kibana.yml index eecd98d..323b381 100644 --- a/kibana/config/kibana.yml +++ b/kibana/config/kibana.yml @@ -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" ] diff --git a/logstash/pipeline/logstash.conf b/logstash/pipeline/logstash.conf index 4338501..5918f01 100644 --- a/logstash/pipeline/logstash.conf +++ b/logstash/pipeline/logstash.conf @@ -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}" } } \ No newline at end of file