노트북으로 홈서버 구축하기 - Grafana + Prometheus로 서버 모니터링하기 (7편)

구성 개요 모니터링 스택은 세 가지로 구성된다. Prometheus — 메트릭 수집 및 저장 Grafana — 대시보드 시각화 Node Exporter — 서버 시스템 메트릭 노출 (CPU, RAM, 디스크, 네트워크 등) Prometheus와 Grafana는 홈서버에서 Docker로 실행하고, Node Exporter는 홈서버와 OCI 서버 양쪽에 systemd로 설치했다. 두 서버가 Tailscale VPN으로 연결돼 있으니 Prometheus가 VPN을 통해 OCI 메트릭도 수집할 수 있다. 서비스 포트 Prometheus 19090 Grafana 13000 Node Exporter 19100 1. 디렉토리 생성 mkdir ~/monitoring && cd ~/monitoring 2. docker-compose.yml 작성 services: prometheus: image: prom/prometheus:latest container_name: prometheus restart: unless-stopped ports: - "19090:9090" volumes: - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro - prometheus_data:/prometheus command: - '--config.file=/etc/prometheus/prometheus.yml' - '--storage.tsdb.path=/prometheus' - '--storage.tsdb.retention.time=30d' grafana: image: grafana/grafana:latest container_name: grafana restart: unless-stopped ports: - "13000:3000" volumes: - grafana_data:/var/lib/grafana environment: - GF_SECURITY_ADMIN_PASSWORD=your_password_here - GF_SERVER_ROOT_URL=http://100.109.108.36:13000 volumes: prometheus_data: grafana_data: version: "3.8" 은 Docker Compose v2부터 obsolete라 생략했다. 넣어도 동작하지만 경고가 뜬다. ...

2026년 3월 29일 · 3 min · 582 words · Chanyeol

Prometheus와 Grafana를 활용한 서버 메트릭 모니터링 구축하기: 안정적인 서비스를 위한 시각화 전략

1. 서론: 왜 단순 로그만으로는 부족한가? 시스템을 운영하다 보면 에러 로그만으로는 원인을 파악하기 힘든 상황에 직면합니다. “갑자기 왜 느려졌지?”, “메모리가 부족한 건 아닐까?”, “현재 동시 접속자 수는 얼마인가?“와 같은 질문에 답하기 위해 필요한 것이 바로 메트릭(Metric) 모니터링입니다. 로그가 **사건(Event)**에 대한 기록이라면, 메트릭은 **상태(State)**에 대한 수치적 기록입니다. 이번 포스트에서는 수치 데이터를 수집하는 Prometheus와 이를 대시보드로 시각화하는 Grafana의 조합을 통해 서비스의 생애 주기를 추적하는 방법을 상세히 알아보겠습니다. 2. 모니터링 스택의 작동 원리 전형적인 모니터링 스택은 Pull 방식을 기반으로 합니다. ...

2026년 3월 6일 · 2 min · 379 words · Chanyeol
1