安装node_exporter和process_exporter文档

1.docker部署node_exporter和process_exporter

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#登录harbor
docker login -u admin -p Harbor12345 172.31.10.118

# 启动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" 172.31.10.118/monitor/node-exporter:v0.18.1

# 启动process-exporter
docker run --restart=always -tid -p 9256:9256 --privileged -v /proc:/host/proc -v `pwd`:/config --name process-exporter 172.31.10.118/monitor/process-exporter:0.7.1 --procfs /host/proc -config.path /config/process-name.yaml

vi process.yml

process_names:
- name: "{{.Matches}}"
cmdline:
- 'mysqld'

process_names:
- name: "{{.Matches}}"
cmdline:
- 'nginx'

- name: "{{.Matches}}"
cmdline:
- 'keepalived'

2.prometheus添加对应配置

1
2
3
kubectl edit cm -n monitoring monitor-prometheus-server
#热部署Prometheus
curl -X POST http://172.31.10.113:41000/-/reload