美文网首页
docker-compose安装prometheus

docker-compose安装prometheus

作者: 程序员大春 | 来源:发表于2022-07-04 10:10 被阅读0次
version: '3.9'

networks:
    monitor:
        driver: bridge

services:
    prometheus:
        image: prom/prometheus:v2.28.1
        container_name: prometheus_gpe
        hostname: prometheus
        restart: always
        volumes:
            - /data/gpe/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
            - /data/gpe/prometheus/data:/prometheus
        command:
            - '--config.file=/etc/prometheus/prometheus.yml'
            - '--storage.tsdb.path=/prometheus'
        ports:
            - "9090:9090"
        networks:
            - monitor

    alertmanager:
        image: prom/alertmanager:v0.22.2
        container_name: alertmanager_gpe
        hostname: alertmanager
        restart: always
        volumes:
            - /data/gpe/alertmanager/alertmanager.yml:/etc/alertmanager/alertmanager.yml
        ports:
            - "9093:9093"
        networks:
            - monitor

    grafana:
        image: grafana/grafana:8.0.6
        container_name: grafana_gpe
        hostname: grafana
        restart: always
        volumes:
            - /data/gpe/grafana/data:/var/lib/grafana
        ports:
            - "3001:3000"
        networks:
            - monitor

prometheus.yml和alertmanager.yml,这两个文件直接docker启动prometheus和alertmanager然后使用容器复制命令复制出来

相关文章

网友评论

      本文标题:docker-compose安装prometheus

      本文链接:https://www.haomeiwen.com/subject/ztldbrtx.html