docker swarm 部署 prometheus 用于监控服务器
Posted 浩如yan海
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了docker swarm 部署 prometheus 用于监控服务器相关的知识,希望对你有一定的参考价值。
compose.yml
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 用于监控服务器的主要内容,如果未能解决你的问题,请参考以下文章