PostgreSQL
PostgreSQL – Grafana 연동
심플이
2021. 5. 31. 10:39
설치하기 전 git, make, go 패키지 설치
# yum install git
# yum install make
# yum install go
git에서 postgres_exporter 가져옴
# git clone https://github.com/prometheus-community/postgres_exporter.git
폴더로 이동 후 빌드
# cd postgres_exporter
# make build
데이터 소스 환경 변수 설정 및 실행
# export DATA_SOURCE_NAME=postgresql://어드민계정:어드민비밀번호@RDS_ENDPOINT:5432/접속DB?sslmode=disable
# . /postgres_exporter
Prometheus에 pgexporter Job 등록
# vi prometheus.yml
Prometheus 서버에 pgexporter가 등록되었는지 확인
http://prometheus서버ip:9090/targets
Prometheus 그래프 확인
http://prometheus서버ip:9090/graph
Grafana에서 대시보드에 그래프 출력
Grafana에 PostgreSQL 직접 등록