1

我正在尝试使用 docker 启动普罗米修斯和警报管理器。

但是,在运行 docker-compose up 时,我遇到了这个错误:

msg="Loading configuration file failed" 
file=/etc/alertmanager/alertmanager.yml err="open 
/etc/alertmanager/alertmanager.yml: no such file or directory"

码头工人-compose.yaml:

version: '2'

services:

prometheus:
    image: prom/prometheus
    privileged: true
    volumes:
        - ./prometheus:/etc/prometheus/
        - ./alertmanager:/alert.rules
    command:
        - --config.file=/etc/prometheus/prometheus.yml
    ports:
        - '9090:9090'

node-exporter:
    image: prom/node-exporter
    ports:
        - '9100:9100'

alertmanager:
    image: prom/alertmanager
    privileged: true
    volumes:
         - ./alertmanager:/etc/alertmanager/
    command:
        - --config.file=/etc/alertmanager/alertmanager.yml
    ports:
        - '9093:9093'

警报管理器.yaml

global:
slack_api_url: 'https://hooks.slack.com/services/eufiwbhfgvehjvfeyvfhevhfvey

route:
  receiver: 'slack'

receivers:
  - name: 'slack'
    slack_configs:
      - send_resolved: true
        username: 'alert'
        channel: '#wgeygyhvdwvy'

Prometheus 和 node-exporter 都运行良好,Alertmanager 的文件结构与 Prometheus 匹配,所以看不到我哪里出错了

4

1 回答 1

1

Alertmanager 抱怨它找不到alertmanager.yml,但你提到你的文件名是alertmanager.yaml. (文件名后缀:ymlvs yaml.)

于 2019-01-31T17:27:26.113 回答