标签:etc global mes $$ env swarm docker art version
version: "3"
services:
prometheus:
image: prom/prometheus:v2.18.1
ports:
- "9090:9090"
volumes:
- /var/prometheus/etc:/etc/prometheus
- /var/prometheus/data:/prometheus
environment:
- TZ=Asia/Shanghai
deploy:
replicas: 1
restart_policy:
condition: on-failure
placement:
constraints:
- node.labels.data-type == nfs
node-exporter:
image: prom/node-exporter:v1.0.0
ports:
- ‘9100:9100‘
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- ‘--path.rootfs=/rootfs‘
- ‘--path.procfs=/host/proc‘
- ‘--path.sysfs=/host/sys‘
- "--collector.filesystem.ignored-mount-points"
- "^/(dev|host|etc|rootfs/var/lib/docker)($$|/)"
environment:
- TZ=Asia/Shanghai
privileged: true
deploy:
mode: global
grafana:
image: grafana/grafana:7.0.0
environment:
- TZ=Asia/Shanghai
ports:
- "3000:3000"
docker swarm 部署 prometheus 用于监控服务器
标签:etc global mes $$ env swarm docker art version
原文地址:https://www.cnblogs.com/wh-blog/p/12979442.html