접속
- 열기
https://<SERVER_IP>:9090브라우저에서. - 인증서가 자체 서명되어 있으므로 브라우저에 인증서 경고가 표시됩니다.
- Prometheus 타겟 페이지는 다음 주소에서 확인할 수 있습니다:
https://<SERVER_IP>:9090/targets. - 메트릭은 다음 주소에서 확인할 수 있습니다:
https://<SERVER_IP>:9090/metrics.
로그인
Prometheus는 HTTP Basic 인증으로 보호됩니다.
- 사용자 이름:
admin - 비밀번호: 저장된 위치
/root/.prometheus-credentials
동일한 인증이 웹 UI, API 및 다음 엔드포인트를 보호합니다: /metrics .
중요한 파일 및 디렉토리
- Prometheus 설정:
/etc/prometheus/prometheus.yml - 웹/TLS/인증 설정:
/etc/prometheus/web-config.yml - TLS 인증서:
/etc/prometheus/tls/ - Prometheus 데이터:
/var/lib/prometheus - Node Exporter Textfile Collector:
/var/lib/node_exporter/textfile_collector - 자격 증명:
/root/.prometheus-credentials - Prometheus 바이너리:
/usr/local/bin/prometheus - Promtool:
/usr/local/bin/promtool - Node Exporter 바이너리:
/usr/local/bin/node_exporter - Prometheus 서비스:
/etc/systemd/system/prometheus.service - Node Exporter 서비스:
/etc/systemd/system/node_exporter.service
서비스 관리
Prometheus 확인:
systemctl status prometheus
Prometheus 재시작:
systemctl restart prometheus
Prometheus 로그 보기:
journalctl -u prometheus -f
Node Exporter 확인:
systemctl status node_exporter
Node Exporter 재시작:
systemctl restart node_exporter
Node Exporter 로그 보기:
journalctl -u node_exporter -f
타겟 추가
편집 /etc/prometheus/prometheus.yml:
vim /etc/prometheus/prometheus.yml
구성을 검증하세요:
promtool check config /etc/prometheus/prometheus.yml
Prometheus 리로드:
curl -sS --cacert /etc/prometheus/tls/prometheus.crt \
-u admin:<PASSWORD> \
-X POST https://localhost:9090/-/reload
보관 기간
Prometheus는 다음과 같이 구성되어 있습니다:
- 보존 기간:
30d - 최대 저장 용량:
10GB
먼저 도달하는 제한이 적용됩니다.
참고
- Grafana와 Alertmanager는 설치되어 있지 않습니다. 별도로 추가하여 이 Prometheus 인스턴스에 연결할 수 있습니다.
- 메트릭은 최대 30일 또는 10 GB까지 보존되며, 먼저 도달하는 제한이 적용됩니다.
- 사용자 지정 호스트 메트릭은
.prom파일로 다음 위치에 추가할 수 있습니다:/var/lib/node_exporter/textfile_collector