环境:
问题:
运行cAdvisor的命令:
sudo docker run --volume = /:/ rootfs:ro --volume = / var / run:/ var / run:rw --volume = / var / lib / docker /:/ var / lib / docker: ro --volume = / dev / disk /:/ dev / disk:ro --publish = 8080:8080 --name = cadvisor --detach = true --privileged = true --volume = / cgroup:/ cgroup:ro --network = docker8443 --ip = 172.28.5.201 google / cadvisor:latest
问题:
答案 0 :(得分:1)
我认为这个问题是关于cadvisor的。 您可以尝试检查cadvisor指标端点:http://172.28.5.201:8080/metrics 确保管理员返回指标样本:
示例:
# HELP container_start_time_seconds Start time of the container since unix epoch in seconds.
# TYPE container_start_time_seconds gauge
container_start_time_seconds{id="/",image="",name=""} 1.525939343e+09
container_start_time_seconds{id="/docker",image="",name=""} 1.526006565e+09
container_start_time_seconds{id="/docker/d4b87911bd0842ee1d6969e6a05aa3d36a48a801184faf14e1b23169e056da92",image="busybox",name="trusting_bassi"}
答案 1 :(得分:0)
除了云龙的回答(添加--volume = / sys:/ sys:ro)
您还需要在shell下运行以下命令:
mount -o remount,rw' / sys / fs / cgroup'
ln -s / sys / fs / cgroup / cpu,cpuacct / sys / fs / cgroup / cpuacct,cpu
否则你的cAdvisor会在容器启动后立即崩溃。