cadvisor主页:https://github.com/google/cadvisor
容器主页:https://hub.docker.com/r/google/cadvisor
cAdvisor 定位为一个监控数据收集器,收集和导出数据是它的强项,而非展示数据。
容器启动
docker run --volume=/:/rootfs:ro --volume=/var/run:/var/run:rw --volume=/sys:/sys:ro --volume=/var/lib/docker/:/var/lib/docker:ro
--hostname=cadvisor --publish=8080:8080 --detach=true --name=cadvisor google/cadvisor -storage_driver=influxdb -storage_driver_host=192.168.134.144:8086
-storage_driver_db=cadvisor -storage_driver_user=root -storage_driver_password=root
通过 http://[Host_IP]:8080 访问 cAdvisor。
获取采集数据
1. 可通过IP:8080/metrics获取所有采集数据(某一时刻)。
2. 将数据导入到数据库中,通过数据库获取数据,如influxdb等。
通过https://github.com/google/cadvisor/tree/master/docs/storage了解对各个数据库支持参数的配置。
特性
cadvisor只能保存1分钟数据,若要长时间保存数据或分析数据,需要结实数据库一起使用。
参考: