Prometheus 및 node_exporter 설정 가이드

15분 소요 - 2026년 5월 29일

hero section cover
목차
  • Prometheus 및 node_exporter 서버 모니터링 설정
  • node_exporter 설치
  • systemd 서비스로 node_exporter 실행하기
  • Prometheus를 구성하여 node_exporter에서 데이터를 수집하기
  • 모니터링 스택 보안
  • 모니터링 모범 사례 및 다음 단계
  • 문제 해결
공유

Prometheus와 node_exporter를 설치하고, 스크랩 대상을 구성하고, 시스템 서비스를 설정하고, 모니터링 스택을 보호하세요. Linux용 단계별 안내.

Prometheus 및 node_exporter 서버 모니터링 설정

Prometheus는 시계열 메트릭을 수집하여 저장합니다. node_exporter는 CPU, 메모리, 디스크 사용량과 같은 시스템 수준 데이터를 노출하여 Prometheus가 이를 수집할 수 있도록 합니다. 이 가이드에서는 두 구성 요소의 설치, 수집 대상 구성, node_exporter를 systemd 서비스로 실행하는 방법 및 액세스 권한 제한에 대해 다룹니다.

node_exporter 설치

공식 GitHub 릴리스 페이지에서 최신 안정 버전을 다운로드하십시오. 2026년 5월 기준, 해당 버전은 1.11.1입니다. amd64arm64 로 교체하십시오.

wget https://github.com/prometheus/node_exporter/releases/download/v1.11.1/node_exporter-1.11.1.linux-amd64.tar.gz

릴리스 페이지에 표시된 값과 SHA256 체크섬을 대조하여 확인한 후, 압축을 풀고 설치하십시오:

tar -xzvf node_exporter-1.11.1.linux-amd64.tar.gz
sudo mv node_exporter-1.11.1.linux-amd64/node_exporter /usr/local/bin/

홈 디렉터리와 로그인 셸이 없는 전용 시스템 사용자를 생성합니다:

sudo useradd --no-create-home --shell /bin/false node_exporter
sudo chown node_exporter:node_exporter /usr/local/bin/node_exporter

다음 명령을 실행하여 테스트하십시오 /usr/local/bin/node_exporter 를 직접 실행하여 테스트한 후, 출력을 확인하십시오:

curl http://localhost:9100/metrics

다음 접두사가 붙은 줄이 표시되어야 합니다 node_로 시작하는 줄이 표시되어야 하며, 여기에는 node_cpu_seconds_totalnode_memory_MemAvailable_bytes와 같은 메트릭이 표시되어야 합니다. 기본적으로 node_exporter는 약 500개의 시계열 데이터를 노출합니다.

systemd 서비스로 node_exporter 실행하기

테스트를 위해 터미널에서 node_exporter를 실행하는 것도 괜찮지만, 세션을 종료하면 서비스가 중지됩니다. 다음 경로에 유닛 파일을 생성하십시오. /etc/systemd/system/node_exporter.service:

[Unit]
Description=Node Exporter
Wants=network-online.target
After=network-online.target
 
[Service]
User=node_exporter
Group=node_exporter
Type=simple
Restart=on-failure
RestartSec=5
ExecStart=/usr/local/bin/node_exporter
 
[Install]
WantedBy=multi-user.target

서비스를 활성화하고 시작합니다:

sudo systemctl daemon-reload
sudo systemctl enable node_exporter
sudo systemctl start node_exporter

다음 명령어로 실행 중인지 확인합니다 sudo systemctl status node_exporter. 출력 결과에는 active (running).

Prometheus가 동일한 호스트에서 실행되는 경우, ExecStart 줄을 수정하여 node_exporter를 localhost에만 바인딩하세요:

ExecStart=/usr/local/bin/node_exporter --web.listen-address="127.0.0.1:9100"

Prometheus를 구성하여 node_exporter에서 데이터를 수집하기

열기 /etc/prometheus/prometheus.yml 를 열고 scrape_configs:

scrape_configs:
  - job_name: 'node_exporter'
    scrape_interval: 15s
    static_configs:
      - targets: ['localhost:9100']
        labels:
          env: 'production'

job_name 는 쿼리 및 대시보드에서 소스를 식별합니다. targets 는 node_exporter가 리스닝하는 호스트와 포트를 가리킵니다. env 나중에 메트릭을 필터링하는 데 도움이 됩니다.

재시작하기 전에 구성을 검증하십시오:

promtool check config /etc/prometheus/prometheus.yml

검사가 통과되면, 서비스 중단 없이 Prometheus를 재로드하십시오:

sudo systemctl reload prometheus

'상태 > 대상(Status > Targets)'으로 이동하여 node_exporter 작업이 녹색 'UP' 상태를 표시 http://<your-prometheus-ip>:9090를 열고, Status > Targets로 이동하여 node_exporter 작업이 녹색 UP 상태를 표시하는지 확인합니다. 데이터가 정상적으로 전송되는지 확인하려면 node_cpu_seconds_total 와 같은 간단한 쿼리를 실행하여 데이터가 정상적으로 전송되는지 확인하세요.

모니터링 스택 보안

포트 9090 또는 9100을 공용 인터넷에 절대 노출하지 마십시오. Ubuntu/Debian에서는 node_exporter의 액세스를 Prometheus 서버의 IP로 제한하십시오:

sudo ufw allow from <prometheus-ip> to any port 9100

firewalld를 사용하는 CentOS/RHEL의 경우:

firewall-cmd --permanent --add-port=9100/tcp

Prometheus 웹 UI의 경우, 기본 인증(Basic Auth)과 TLS를 적용한 Nginx와 같은 리버스 프록시 뒤에 배치하십시오. 포트를 직접 노출하지 않고 여러 위치에서 액세스해야 하는 경우, Tailscale과 같은 메쉬 VPN을 사용하는 것도 또 다른 방법입니다.

모니터링 모범 사례 및 다음 단계

다음 용어를 사용하십시오 node_memory_MemAvailable_bytes 를 사용하십시오 MemFree 를 사용하십시오. MemAvailable 버퍼와 캐시를 고려하여 실제로 사용 가능한 용량을 더 정확하게 파악할 수 있습니다.

필요 없는 수집기(wifi, nfs, bcache)는 --no-collector.<name> 플래그를 사용하여 불필요한 수집기(wifi, nfs, bcache)를 비활성화하여 알림의 빈도를 줄이십시오.

디스크 공간 알림의 경우, predict_linear PromQL 함수를 사용하면 현재 추세를 바탕으로 볼륨이 언제 가득 찰지 예측할 수 있습니다. 7일 예측 기간을 설정하면 서비스 중단으로 이어지기 전에 느린 메모리 누수를 포착할 수 있습니다.

여러 서버를 모니터링하려면 각 머신에 node_exporter를 설치하고 해당 IP를 targets 목록에 추가하십시오 prometheus.yml목록에 추가하십시오. 대규모 환경의 경우 IP를 하드코딩하는 대신 파일 기반 서비스 검색으로 전환하십시오.

Grafana를 추가하면 시각적인 대시보드를 사용할 수 있습니다. Node Exporter Full 대시보드(ID 1860)는 시작하기에 좋은 선택입니다. Alertmanager는 중요 알림을 Slack, 이메일 또는 PagerDuty로 전달합니다.

FDC의 전용 서버 및 VPS 플랜은 기본적으로 Prometheus와 node_exporter를 지원합니다. FDC의 전용 서버 옵션을 확인해 보세요.

문제 해결

문제가능한 원인확인 명령어
서비스가 시작되지 않음바이너리 경로 또는 권한 오류journalctl -u node_exporter -xe
메트릭에 연결할 수 없음방화벽이 포트 9100을 차단하거나 바인드 주소가 잘못됨ss -lntp | grep 9100
Prometheus에서 대상 다운네트워크 문제 또는 prometheus.yml의 대상 IP가 잘못됨curl -I http://<target-ip>:9100/metrics
특정 메트릭이 누락됨컬렉터가 기본적으로 비활성화됨node_exporter --help

블로그

이번 주 추천

더 많은 기사
Prometheus 및 node_exporter 설정 가이드

Prometheus 및 node_exporter 설정 가이드

Prometheus와 node_exporter를 설치하고, 스크랩 대상을 구성하고, 시스템 서비스를 설정하고, 모니터링 스택을 보호하세요. Linux용 단계별 안내.

15분 소요 - 2026년 5월 29일

Linux 패킷 처리를 위한 XDP 및 eBPF

14분 소요 - 2026년 5월 27일

더 많은 기사
background image

질문이 있거나 맞춤형 솔루션이 필요하신가요?

icon

유연한 옵션

icon

글로벌 도달 범위

icon

즉시 배포

icon

유연한 옵션

icon

글로벌 도달 범위

icon

즉시 배포