Docker容器监控之CAdvisor+InfluxDB+Granfana

是什么

CAdvisor监控收集+InfluxDB存储数据+Granfana展示图表

CAdvisor

Docker容器监控之CAdvisor+InfluxDB+Granfana_第1张图片


InfluxDB

Docker容器监控之CAdvisor+InfluxDB+Granfana_第2张图片
Granfana

Docker容器监控之CAdvisor+InfluxDB+Granfana_第3张图片
总结

Docker容器监控之CAdvisor+InfluxDB+Granfana_第4张图片

compose容器编排,一套带走

1、新建目录

Docker容器监控之CAdvisor+InfluxDB+Granfana_第5张图片
2、新建3件套组合的 docker-compose.yml

version: '3.1'
 
volumes:
  grafana_data: {}
 
services:
 influxdb:
  image: tutum/influxdb:0.9
  restart: always
  environment:
    - PRE_CREATE_DB=cadvisor
  ports:
    - "8083:8083"
    - "8086:8086"
  volumes:
    - ./data/influxdb:/data
 
 cadvisor:
  image: google/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:
  user: "104"
  image: grafana/grafana
  user: "104"
  restart: always
  links:
    - influxdb:influxsrv
  ports:
    - "3000:3000"
  volumes:
    - grafana_data:/var/lib/grafana
  environment:
    - HTTP_USER=admin
    - HTTP_PASS=admin
    - INFLUXDB_HOST=influxsrv
    - INFLUXDB_PORT=8086
    - INFLUXDB_NAME=cadvisor
    - INFLUXDB_USER=root
    - INFLUXDB_PASS=root


3、启动docker-compose文件
  docker-compose up

Docker容器监控之CAdvisor+InfluxDB+Granfana_第6张图片
4、查看三个服务容器是否启动

Docker容器监控之CAdvisor+InfluxDB+Granfana_第7张图片
5、测试

  • 浏览cAdvisor收集服务,http://ip:8080/
  • 浏览influxdb存储服务,http://ip:8083/
  • 浏览grafana展现服务,http://ip:3000

 grafana ip+3000端口的方式访问,默认帐户密码(admin/admin)

Docker容器监控之CAdvisor+InfluxDB+Granfana_第8张图片
  配置步骤

  1.     配置数据源Docker容器监控之CAdvisor+InfluxDB+Granfana_第9张图片
  2.     选择influxdb数据源Docker容器监控之CAdvisor+InfluxDB+Granfana_第10张图片
  3.     配置细节

Docker容器监控之CAdvisor+InfluxDB+Granfana_第11张图片

Docker容器监控之CAdvisor+InfluxDB+Granfana_第12张图片


      4.  配置面板panel

Docker容器监控之CAdvisor+InfluxDB+Granfana_第13张图片

Docker容器监控之CAdvisor+InfluxDB+Granfana_第14张图片

Docker容器监控之CAdvisor+InfluxDB+Granfana_第15张图片

Docker容器监控之CAdvisor+InfluxDB+Granfana_第16张图片

Docker容器监控之CAdvisor+InfluxDB+Granfana_第17张图片

Docker容器监控之CAdvisor+InfluxDB+Granfana_第18张图片
 到这里cAdvisor+InfluxDB+Grafana容器监控系统就部署完成了

你可能感兴趣的:(Docker,docker,容器,运维)