른록노트

[Elasticsearch] firebeats 설치 - 5 본문

DB/[Elasticsearch]

[Elasticsearch] firebeats 설치 - 5

른록 2020. 9. 28. 01:14

@ 시작하기전

Window PC에서 VMware로 Linux서버 3대로 클러스터 구성할 계획입니다.

서버사양

OS : CentOS7.4

CPU : 3 core

Memory : 4 GB

Elasticsearch Version : 7.9.1

security 적용한 상태입니다 (이전글 llnote.tistory.com/681)

kibana 설치한 상태입니다 (이전글 llnote.tistory.com/682)

logstash 설치한 상태입니다 (이전글 llnote.tistory.com/683)

 

@ 목표

filebeats를 실행하여 엘라스틱 클러스터 로그 데이터를 logstash로 전달하여

logstash에서 5044포트로 beats input을 받아 엘라스틱으로 데이터 전송 (인덱스명은 filebeats-날짜형식)

 

@ 방법

> vim 로그스태쉬경로/conf/example.conf

input {
  beats {
    port => 5044
  }
}

output {
  elasticsearch {
      hosts => ["https://server-1:9200","https://server-2:9200","https://server-3:9200"]
      user => "계정"
      password => "비밀번호"
      index => 'filebeats-%{+YYYY.MM.dd}'
      ssl => true
          ssl_certificate_verification => false
          keystore => "엘라스틱경로/config/elastic-certificates.p12"
          keystore_password => ""
          truststore => "엘라스틱경로/config/elastic-certificates.p12"
          truststore_password => ""
  }
}

> bin/logstash

 

[새로운 터미널]

 

> curl https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.9.1-linux-x86_64.tar.gz -O

> tar -xvf filebeat-7.9.1-linux-x86_64.tar.gz 

> cd filebeat-7.9.1-linux-x86_64

> cp filebeat.yml filebeat.yml.back

> vim filebeat.yml

filebeat.inputs:
- type: log

  enabled: true

  # Paths that should be crawled and fetched. Glob based paths.
  paths:
    - /엘라스틱/클러스터명.log
    
output.logstash:
  # The Logstash hosts
  hosts: ["localhost:5044"]

 

> ./filebeat

 

@ 확인

키바나에서 filebeats 인덱스 저장 되었는지 확인

 

@ 마치며

이로써 ELASTIC (ELK) STACK을 다 설치해봤습니다.

이제 kafka와 zookeeper, spark를 공부해보겠습니다.

반응형
Comments