菜单 学习猿地 - LMONKEY

VIP

开通学习猿地VIP

尊享10项VIP特权 持续新增

知识通关挑战

打卡带练!告别无效练习

接私单赚外块

VIP优先接,累计金额超百万

学习猿地私房课免费学

大厂实战课仅对VIP开放

你的一对一导师

每月可免费咨询大牛30次

领取更多软件工程师实用特权

入驻
180
0

docker-prometheus

原创
05/13 14:22
阅读数 70126

docker-compose部署prometheus监控

docker-prometheus.yml 

version: '3'
services:
  #添加普罗米修斯服务
  prometheus:
    image: prom/prometheus:latest
    container_name: Myprometheus
    hostname: prometheus
    ports:
      - '9090:9090'
    volumes:
      - '/data/conf/prometheus.yml:/etc/prometheus/prometheus.yml'
      - '/data/prometheus/:/prometheus'
    # 指定容器中的配置文件
    command:
      - '--config.file=/etc/prometheus/prometheus.yml'
      # 支持热更新
      - '--web.enable-lifecycle'
      - '--web.enable-admin-api'
      - '--storage.tsdb.path=/prometheus'

  # 添加告警模块
  alertmanager:
    image: prom/alertmanager:latest
    container_name: Myalertmanager
    hostname: alertmanager
    restart: always
    ports:
      - '9093:9093'
    volumes:
      - '/data/conf/alertmanager.yml:/etc/alertmanager/alertmanager.yml'
      - '/data/alertmanager/:/alertmanager/data'
    command:
      - '--config.file=/etc/alertmanager/alertmanager.yml'

  # 添加监控可视化面板
  grafana:
    image: grafana/grafana
    container_name: grafana
    hostname: grafana
    restart: always
    ports:
      - '3000:3000'
    volumes:
      - '/data/grafana/:/var/lib/grafana'
      - '/data/grafana/logs/:/var/log/grafana'

  # 添加客户端监控
  exporter:
    image: prom/node-exporter:latest
    container_name: node-export
    ports:
     - "9100:9100"
  # 收集容器数据
  cadvisor:
    image: google/cadvisor:v0.24.1
    container_name: cadvisor
    hostname: cadvisor
    restart: always
    volumes:
      - /:/rootfs:ro
      - /var/run:/var/run:rw
      - /sys:/sys:ro
      - /var/lib/docker/:/var/lib/docker:ro
    ports:
      - "8080:8080"

 

发表评论

0/200
180 点赞
0 评论
收藏