(구축)-Prometheus 이용한 서버 모니터링
개요
ELK를 사용 해보고 재미가 붙어 다른것도 구축 해보기로 하였다.
Push 방식이 아닌 Pull 방식인거는 내가 원하는 구조라 ELK보다 더 맘에 들었다.
느낀점
Prometheus와 Granfa로 연동 하였는데 Grafana는 평소에 사용하던 거라서 구축하는게 쉬웠다.
ELK와 달리 심플한 구조로 동작하여 구축하는데도 어렵지 않고 확장성 면에서는 beats가 좋은것도 같지만 System resource 사용률에 대한 모니터링으로는 충분하며 구축이 쉬어 개인적으로 Prometheus를 선호 할 것 같다.
구축하는데 1일 소요되었는데 그만큼 간편한거 같아 맘에든다.
Promtheus Install
wget https://github.com/prometheus/prometheus/releases/download/v2.24.1/prometheus-2.24.1.linux-amd64.tar.gz
Node Exporter Install
wget https://github.com/prometheus/node_exporter/releases/download/v1.0.1/node_exporter-1.0.1.linux-amd64.tar.gz
Prometheus Config
vi prometheus.yml
- job_name: 'node-exporter'
static_configs:
- targets: ['x.x.x.x:9500', 'x.x.x.x:9500']
Prometheus CMD
./prometheus --web.listen-address=0.0.0.0:9800
Node Exporter CMD
./node_exporter --web.listen-address=0.0.0.0:9500
예시
참고자료
- Grafana Dashboard Sample
- https://grafana.com/grafana/dashboards
- Prometheus Config Guide
- https://prometheus.io/docs/prometheus/latest/configuration/configuration