介绍:CAdvisor监控收集+InfluxDB存储数据+Granfana展示图表
目录
1、新建3件套组合的docker-compose.yml
2、查看三个服务容器是否启动
3、浏览cAdvisor收集服务,http://ip:8080/
4、浏览influxdb存储服务,http://ip:8083/
5、浏览grafana展现服务,http://ip:3000(用户admin默认密码admin)
6、添加数据源
7、配置面板panel
1、新建3件套组合的docker-compose.yml
mkdir cig
cd cig/
vim docker-compose.ymlversion: '3.1'volumes:grafana_data: {}services:influxdb:image: tutum/influxdbrestart: alwaysenvironment:- PRE_CREATE_DB=cadvisorports:- "8083:8083"- "8086:8086"volumes:- ./data/influxdb:/datacadvisor:image: google/cadvisorlinks:- influxdb:influxsrvcommand: -storage_driver=influxdb -storage_driver_db=cadvisor -storage_driver_host=influxsrv:8086restart: alwaysports:- "8080:8080"volumes:- /:/rootfs:ro- /var/run:/var/run:rw- /sys:/sys:ro- /var/lib/docker/:/var/lib/docker:rografana:user: "104"image: grafana/grafanauser: "104"restart: alwayslinks:- influxdb:influxsrvports:- "3000:3000"volumes:- grafana_data:/var/lib/grafanaenvironment:- HTTP_USER=admin- HTTP_PASS=admin- INFLUXDB_HOST=influxsrv- INFLUXDB_PORT=8086- INFLUXDB_NAME=cadvisor- INFLUXDB_USER=root- INFLUXDB_PASS=root
docker-compose config -q #检查文件是否有问题docker-compose up #启动文件
2、查看三个服务容器是否启动
3、浏览cAdvisor收集服务,http://ip:8080/
cadvisor也有基础的图形展现功能,这里主要用它来作数据采集
4、浏览influxdb存储服务,http://ip:8083/
5、浏览grafana展现服务,http://ip:3000(用户admin默认密码admin)
6、添加数据源
7、配置面板panel
到这里cAdvisor+InfluxDB+Grafana容器监控系统就部署完成了