一、安裝cadvisor
docker pull google/cadvisor:latest
二、運(yùn)行容器
docker run -d \
--volume=/:/rootfs:ro \
--volume=/var/run:/var/run:rw \
--volume=/sys:/sys:ro \
--volume=/var/lib/docker/:/var/lib/docker:ro \
--publish=8088:8080 \
--detach=true \
--name=cadvisor \
--privileged=true \
google/cadvisor:latest
若出現(xiàn)如下報(bào)錯(cuò)
Failed to start container manager: inotify_add_watch /sys/fs/cgroup/cpuacct,cpu: no such file or directory
執(zhí)行
mount -o remount,rw '/sys/fs/cgroup'
ln -s /sys/fs/cgroup/cpu,cpuacct /sys/fs/cgroup/cpuacct,cpu
三、訪問頁面
ip:8088
四、Prometheus集成
vim prometheus.yml
- job_name: cadvisor-106
static_configs:
- targets: ['192.168.xx.xx:8088']
五、在grafana中導(dǎo)入面板
文章來源:http://www.zghlxwxcb.cn/news/detail-680204.html
六、監(jiān)控圖
文章來源地址http://www.zghlxwxcb.cn/news/detail-680204.html
到了這里,關(guān)于prometheus+cadvisor監(jiān)控docker容器的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!