美文网首页
Docker搭建Prometheus客户端*

Docker搭建Prometheus客户端*

作者: SkTj | 来源:发表于2020-01-06 13:51 被阅读0次

mkdir -p /usr/local/node_exporter/prom

1、docker-compose.yml
cadvisor:
image: google/cadvisor:latest
container_name: cadvisor
restart: unless-stopped
ports:
- '8080:8080'
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro

node-exporter:
image: prom/node-exporter:latest
container_name: node-exporter
restart: unless-stopped
ports:
- '9100:9100'
command:
- '--path.procfs=/host/proc'
- '--path.sysfs=/host/sys'
- '--collector.textfile.directory=/node_exporter/prom'
- '--collector.systemd'
- '--collector.systemd.unit-whitelist=(docker|sshd|rsyslog).service'
volumes:
- /proc:/host/proc
- /sys:/host/sys
- /var/run:/var/run:rw
- /:/rootfs
- /usr/local/node_exporter/prom:/node_exporter/prom
2、pip install docker-compose
docker-compose -f docker-compose.yml
3、prometheus 修改配置文件 prometheus.yml
重启docker: docker restart prometheus

相关文章

网友评论

      本文标题:Docker搭建Prometheus客户端*

      本文链接:https://www.haomeiwen.com/subject/jcnqactx.html