• docker-prometheus


    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"
  • 相关阅读:
    equals 和 == 的区别
    jenkins
    状态码
    对控制反转和依赖注入的突然顿悟
    分布式事务与Seate框架
    synchronized原理
    VS 添加 Sqlserver
    C# 生成二维码
    jQuery /Date(0000000000000)/日期转换
    什么是Java的序列化,在哪些程序中见过Java序列化?
  • 原文地址:https://www.cnblogs.com/saneri/p/14558097.html
Copyright © 2020-2023  润新知