(구축)-ELK를 이용한 서버 모니터링

less than 1 minute read

개요

공부겸 server monitoring open source 검색중 대세인 ELK를 한번 도전해 보고 싶었다.


느낀점

shell -> API -> Influx or Postgresql -> Grafana

평소에는 위와 같은 구조로 만들어서 모니터링 하였는데 ELK를 해보니 확실히 직접 개발 하는 것보다 기능이 다양하고 구조적으로 퀄리티가 다른거 같았다.
단점으로는 기술 스택을 이해해야 하는등 과정이 필요하여 간단한 모니터링에 있어서는 오히려 오래 걸리고 불편한 점도 있었다.
재미는 있었던거 같다 Grafana나 Kibana나 둘다 자료가 별로 없는것 같아 그부분은 아쉬웠다.


Elasticsearch Install

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.10.2-linux-x86_64.tar.gz

Kibana Install

wget https://artifacts.elastic.co/downloads/kibana/kibana-7.10.2-linux-x86_64.tar.gz

Logstash Install

wget https://artifacts.elastic.co/downloads/logstash/logstash-7.10.2-linux-x86_64.tar.gz

Kernel Config

vi /etc/sysctl.conf

vm.max_map_count=262144
sysctl -p

Elasticsearch Config

vi elasticsearch.yml

network.host: 0.0.0.0
discovery.seed_hosts: ["127.0.0.1", "[::1]"]
cluster.initial_master_nodes: ["test.monitor.kr"]

Kibana Config

vi kibana.yml

server.port: 3300
server.host: "0.0.0.0"
server.name: "monitoring_test"

Logstash Config


Beats

Metricbeat Install

wget https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-7.10.2-linux-x86_64.tar.gz

Metricbeat Config

vi metricbeat.yml

setup.kibana:
    host: "test.monitor.kr:3300"
output.elasticsearch:
    hosts: ["test.monitor.kr:9200"]

Metricbeat CMD

# Setup
./metricbeat setup -c metricbeat.yml

# Start
./metricbeat -e

# Module Append
metricbeat modules enable elasticsearch-xpack
metricbeat modules enable linux
metricbeat modules enable system

Updated: