Docker搭建prometheus(普罗米修斯)的方法步骤

  version: '2'

  networks:

  monitor:

  driver: bridge

  services:

  prometheus:

  image: prom/prometheus

  container_name: prometheus

  hostname: prometheus

  restart: always

  volumes:

  - http://www.jb51.net/server/prometheus.yml:/etc/prometheus/prometheus.yml

  # - http://www.jb51.net/server/node_down.yml:/usr/local/etc/node_down.yml:rw

  ports:

  - "9090:9090"

  networks:

  - monitor

  alertmanager:

  image: prom/alertmanager

  container_name: alertmanager

  hostname: alertmanager

  restart: always

  # volumes:

  # - http://www.jb51.net/server/alertmanager.yml:/usr/local/etc/alertmanager.yml

  ports:

  - "9093:9093"

  networks:

  - monitor

  grafana:

  image: grafana/grafana

  container_name: grafana

  hostname: grafana

  restart: always

  ports:

  - "3000:3000"

  networks:

  - monitor

  node-exporter:

  image: quay.io/prometheus/node-exporter

  container_name: node-exporter

  hostname: node-exporter

  restart: always

  ports:

  - "9100:9100"

  networks:

  - monitor

  cadvisor:

  image: google/cadvisor:latest

  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:

  - "8899:8080"

  networks:

  - monitor