노트북으로 홈서버 구축하기 - 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라 생략했다. 넣어도 동작하지만 경고가 뜬다. ...

March 29, 2026 · 3 min · 582 words · Chanyeol
1