码迷,mamicode.com
首页 > 其他好文 > 详细

docker swarm 部署 prometheus 用于监控服务器

时间:2020-05-28 11:37:43      阅读:90      评论:0      收藏:0      [点我收藏+]

标签:etc   global   mes   $$   env   swarm   docker   art   version   

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 用于监控服务器

标签:etc   global   mes   $$   env   swarm   docker   art   version   

原文地址:https://www.cnblogs.com/wh-blog/p/12979442.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!