1、部署node_exporter数据采集
docker run -d --name=node-exporter \ --restart=always \ -p 9100:9100 \ -v "/proc:/host/proc:ro" \ -v "/sys:/host/sys:ro" \ -v "/:/rootfs:ro" \ prom/node-exporter 访问: http://192.168.4.12:9100/metrics
2、部署Prometheus 监控
1、编写配置文件
# vim /opt/prometheus.yml global: scrape_interval: 60s evaluation_interval: 60s scrape_configs: - job_name: prometheus static_configs: - targets: ['localhost:9090'] labels: instance: prometheus - job_name: linux static_configs: - targets: ['172.17.2.4:9100'] labels: instance: localhost
2、启动 docker run -d --name=prometheus \ -v /opt/prometheus.yml:/etc/prometheus/prometheus.yml \ --restart=always \ -p 9090:9090 \ prom/prometheus 3、访问:
http://192.168.4.12:9090
http://192.168.4.12:9090/graph http://192.168.4.12:9090/targets
3、部署Grafana可视化工具
1、创建目录,存储数据 # mkdir /data/grafana # chmod 777 /data/grafana
2、启动 docker run -d --name=grafana \ -v /data/grafana:/var/lib/grafana \ --restart=always \ -p 3000:3000 \ grafana/grafana
4、配置
标签:name,部署,9090,Prometheus,grafana,--,prometheus,docker From: https://www.cnblogs.com/wuhg/p/17385881.html