小编Moh*_*hid的帖子

如何更改Prometheus监控的cadvisor和node-exporter中的端口号

下面是当我点击目标时 prometheus URL 中的显示。

cadvisor(0/1 向上)和节点导出器(0/1 向上)显示在 Prometheus URL 中

这是我的 filename.yml 文件

version: '3.2'

services:

  prometheus:
       image: prom/prometheus:latest
#       container_name: monitoring_prometheus
       command:
         - '--config.file=/etc/prometheus/prometheus.yml'
         - '--storage.tsdb.path=/prometheus'
         - '--web.console.libraries=/usr/share/prometheus/console_libraries'
         - '--web.console.templates=/usr/share/prometheus/consoles'
       volumes:
         - /Prometheus/alert.rules:/etc/prometheus/alert.rules
         - /Prometheus/container.yml:/etc/prometheus/container.yml
         - /Prometheus/diskusage.yml:/etc/prometheus/diskusage.yml
         - ./prometheus.yml:/etc/prometheus/prometheus.yml
       ports:
         - 9090:9090

  node-exporter:       
       image: prom/node-exporter:latest
#       container_name: monitoring_node_exporter       
       volumes:       
         - /proc:/host/proc:ro       
         - /sys:/host/sys:ro       
         - /:/rootfs:ro       
       ports:
         - 9091:9091
       command:       
         - '--path.procfs=/host/proc'       
         - '--path.sysfs=/host/sys'       
         - '--path.rootfs=/host'       
         - '--collector.filesystem.ignored-mount-points="^(/rootfs|/host|)/(sys|proc|dev|host|etc)($$|/)"'       
         - '--collector.filesystem.ignored-fs-types="^(sys|proc|auto|cgroup|devpts|ns|au|fuse\.lxc|mqueue)(fs|)$$"'       


  cadvisor:
       image: google/cadvisor:latest
#       container_name: monitoring_cadvisor
       ports:
         - 9092:9092
       volumes: …
Run Code Online (Sandbox Code Playgroud)

docker prometheus prometheus-operator prometheus-alertmanager prometheus-node-exporter

3
推荐指数
1
解决办法
6858
查看次数