赞
踩
1、部署prometheus、grafana
监控主机上部署prometheus、grafana
启动prometheus:
docker run -d -p 9090:9090 -v /data/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus
cat /data/prometheus/prometheus.yml
global:
scrape_interval: 15s
evaluation_interval: 15s
alerting:
alertmanagers:
- static_configs:
- targets:
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['192.168.4.148:9090']
- job_name: 'linux'
static_configs:
- targets: ['192.168.4.134:9100','192.168.4.135:9100','192.168.4.136:9100']
- job_name: 'docker'
static_configs:
- targets: ['192.168.4.134:9994','192.168.4.135:9994','192.168.4.136:9994']
启动grafana :
docker run -d -p 3000:3000 --name=grafana grafana/grafana
访问http://192.168.4.148:9090
访问http://192.168.4.148:3000
2、k8s node节点、docker主机:部署node-exporter、cadvisor
启动node-exporter:
docker run -d -p 9100:9100 --net='host' prom/node-exporter
启动cadvisor:
docker run --volume=/:/rootfs:ro --volume=/var/run:/var/run:rw \
--volume=/sys:/sys:ro --volume=/var/lib/docker/:/var/lib/docker:ro \
--publish=9994:8080 --detach=true --name=cadvisor --restart=always google/cadvisor
3、加入模板即可
dashboards模版id
7362 mysql
10467 监控物理机/虚拟机(windows)
8919 监控物理机/虚拟机(linux)
9614 nginx
监控容器
8321
3146
8685
10000
8588
315
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。