docker-compose部署prometheus
生活随笔
收集整理的這篇文章主要介紹了
docker-compose部署prometheus
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
目錄結構
主節點docker-compose.yml
去掉了altermanager和dingtalk告警的部署
prometheus server節點prometheus node_exporter grafana三個組件都需要部署
version: '3.7' services:node-exporter:image: prom/node-exporter:latestports:- "9100:9100"networks:- prom# dingtalk: # image: timonwong/prometheus-webhook-dingtalk:latest # volumes: # - type: bind # source: ./alertmanager/config.yml # target: /etc/prometheus-webhook-dingtalk/config.yml # read_only: true # ports: # - "8060:8060" # networks: # - prom# alertmanager: # depends_on: # - dingtalk # image: prom/alertmanager:latest # volumes: # - type: bind # source: ./alertmanager/alertmanager.yml # target: /etc/alertmanager/alertmanager.yml # read_only: true # ports: # - "9093:9093" # - "9094:9094" # networks: # - promprometheus:image: prom/prometheus:latestvolumes:- type: bindsource: ./prometheus/prometheus.ymltarget: /etc/prometheus/prometheus.ymlread_only: true- type: volumesource: prometheustarget: /prometheusports:- "9090:9090"networks:- promgrafana:depends_on:- prometheusimage: grafana/grafana:latestvolumes:- type: volumesource: grafanatarget: /var/lib/grafanaports:- "3000:3000"networks:- promvolumes:prometheus:driver: localdriver_opts:type: noneo: binddevice: /opt/dmgeo/prom/prometheus/datagrafana:driver: localdriver_opts:type: noneo: binddevice: /opt/dmgeo/prom/grafananetworks:prom:driver: bridgeprometheus.yml
global:scrape_interval: 15sevaluation_interval: 15s#alerting: # alertmanagers: # - static_configs: # - targets: # - alertmanager:9093rule_files:- "*rules.yml"scrape_configs:- job_name: 'prometheus'static_configs:- targets: ['prometheus:9090']- job_name: 'node'static_configs:- targets: ['node-exporter:9100','192.168.123.12:9100','192.168.123.13:9100']# - job_name: 'alertmanager' # static_configs: # - targets: ['alertmanager:9093']從節點docker-compose.yaml
從節點只需要部署node-exporter
version: '3.7' services:node-exporter:image: prom/node-exporter:latestports:- "9100:9100"部署結果
主節點
從節點
grafana導入監控模板
參考鏈接:
docker-compose 部署prometheus + grafana
Prometheus監控平臺配置node_exporter
總結
以上是生活随笔為你收集整理的docker-compose部署prometheus的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: K8S operator方式部署redi
- 下一篇: 【收藏】K8S部署minio对象存储