是什么
一句话:CAdvisor监控收集+InfluxDB存储数据+Granfana展示图表
CAdvisor
InfluxDB
Granfana
总结
容器编排CIG
CIG = CAdvisor+InfluxDB+Granfana
1、新建目录
2、新建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
4、查看服务是否启动
5、浏览cAdvisorL收集服务,http://ip:8080/
备注:第一次访问慢,请稍等,cadvisor也有基础的图形展现功能,这里主要用它来作数据采集
6、浏览influxdb存储服务,http://ip:8083/
7、浏览grafana展现服务,http://ip:3000
ip+3000端口的方式访问,默认帐户密码(admin/admin)
配置步骤:
a、配置数据源
b、选择InfluxDB
c、配置面板panel
d、到这里cAdvisor+-InfluxDB+Grafana容器监控系统就部署完成了