Prometheus+Grafana监控PostgreSQL
Prometheus:2.32.0
Grafana:8.3.3
PG:13.2
Linux:CentOS7.6
docker:18.06.3
1、安装Prometheus
下载地址;https://prometheus.io/download/
[root@wcbpg ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
mambapg13 1.0 bb50c95ef78c 6 hours ago 2.56GB
wcbcentos76 1.0 6877e73a2018 2 weeks ago 1.9GB
wcbpg 1.0 988fc4d35414 2 weeks ago 1.9GB
registry.cn-hangzhou.aliyuncs.com/lhrbest/lhrpgall 1.0 a726460146fc 7 months ago 3.96GB
centos 7.6.1810 f1cb7c7d58b7 2 years ago 202MB
[root@wcbpg ~]#
[root@wcbpg ~]#docker run -d --name mambaprometheus -h mambaprometheus \
-p 12222:22 -p 23389:3389 -p 29090:9090 -p 29093:9093 -p 23000:3000 \
--privileged=true centos:7.6.1810 \
/usr/sbin/init
108317a2ba8151870f8d38450b9b359742752de0412cf49b4ba7849f3f784f66
[root@wcbpg ~]# pwd
/root
[root@wcbpg ~]# ls -lth
total 79M
-rw-r--r-- 1 root root 72M Dec 18 18:59 prometheus-2.32.0.linux-amd64.tar.gz
-rw-r--r-- 1 root root 16 Dec 9 23:20 file3.txt
-rw-r--r-- 1 root root 37 Dec 9 23:19 file2.txt
drwxr-xr-x 2 root root 31 Dec 8 23:32 data
-rw-r--r-- 1 root root 6.7M Dec 8 10:07 postgres_exporter-0.9.0.linux-amd64.tar.gz
-rw-------.