一、搭建基于Prometheus、Grafana监控系统
CentOS Linux release 7.6.1810 (Core)
二、Grafana 可视化界面示例
三、启动相关Docker服务
#yum install -y docker-io
docker pull prom/node-exporter
docker pull prom/prometheus
docker pull grafana/grafana
四、启动node-exporter
docker run -d -p 9100:9100 \
-v "/proc:/host/proc:ro" \
-v "/sys:/host/sys:ro" \
-v "/:/rootfs:ro" \
--net="host" \
prom/node-exporter
查看端口占用
netstat -anpt
URL 查看
http://192.168.91.132:9100/metrics
五、启动Prometheus并配置相关文件
mkdir /opt/prometheus
cd /opt/prometheus/
vim prometheus.ym
►prometheus.yml
global:
scrape_interval: 60s
evaluation_interval: 60s
scrape_configs:
- job_name: prometheus
static_configs:
- targets: ['IP:9090']
labels:
instance: prometheus
- job_name: linux
static_configs:
- targets: ['IP:9100']
labels:
instance: localhost
启动
docker run -d \
-p 9090:9090 \
-v /opt/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml \
prom/prometheus
查看Targets
http://IP:9090/targets
六、启动Grafana
mkdir /opt/grafana-storage
chmod 777 -R /opt/grafana-storage
启动
docker run -d \
-p 3000:3000 \
--name=grafana \
-v /opt/grafana-storage:/var/lib/grafana \
grafana/grafana
标签:opt,9090,Prometheus,grafana,prometheus,docker,Grafana,Docker
From: https://www.cnblogs.com/hflinux/p/18560310