grafana+cadvisor+influxdb 使用docker-compose實現監控

//如下內容直接複製到 docker-compose.yml 文件中。執行命令docker-compose up -d
以後訪問 http://ip:3000 剩下的以後的測試鏈接數據庫和監控本身百度docker

version: '3'數據庫

services:
influxdb:
image: tutum/influxdb:0.9
container_name: influxdb
restart: always
environment:ide

  • PRE_CREATE_DB=cadvisor
    ports:
  • "8083:8083"
  • "8086:8086"
    expose:
  • "8090"
  • "8099"
    volumes:
  • influxdbData:/data
    cadvisor:
    image: google/cadvisor
    container_name: cadvisor
    links:
  • influxdb:influxsrv
    command: -storage_driver=influxdb -storage_driver_db=cadvisor -storage_driver_host=influxsrv:8086
    restart: always
    ports:
  • "8080:8080"
    volumes:
  • /:/rootfs:ro
  • /var/run:/var/run:rw
  • /sys:/sys:ro
  • /var/lib/docker/:/var/lib/docker:ro
    grafana:
    image: grafana/grafana
    container_name: grafana
    restart: always
    links:
  • influxdb:influxsrv
    ports:
  • "3000:3000"
    environment:
  • HTTP_USER=admin
  • HTTP_PASS=admin
  • INFLUXDB_HOST=influxsrv
  • INFLUXDB_PORT=8086
  • INFLUXDB_NAME=cadvisor
  • INFLUXDB_USER=root
  • INFLUXDB_PASS=root

volumes:
influxdbData:測試

相關文章
相關標籤/搜索