介绍: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.yml
version: '3.1'
volumes:
grafana_data: {}
services:
influxdb:
image: tutum/influxdb
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
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容器监控系统就部署完成了