Docker 在 Ubuntu 中抛出两个与 cgroup rt period/runtime 相关的警告

Docker 在 Ubuntu 中抛出两个与 cgroup rt period/runtime 相关的警告

当我跑步时docker &我得到:

INFO[0000] libcontainerd: new containerd process, pid: 3091 
INFO[0000] [graphdriver] using prior storage driver: aufs 
INFO[0000] Graph migration to content-addressability took 0.00 seconds 
WARN[0000] Your kernel does not support cgroup rt period 
WARN[0000] Your kernel does not support cgroup rt runtime 
INFO[0000] Loading containers: start.

我还收到所有这些警告:

WARN[0000] libcontainerd: client is out of sync, restore was called on a fully synced container (8564990571b56c26f32872031507e77f786b870b27ed3f0b80eebe127ce65164). 
WARN[0000] libcontainerd: failed to retrieve container 8564990571b56c26f32872031507e77f786b870b27ed3f0b80eebe127ce65164 state: rpc error: code = 2 desc = containerd: container not found 
WARN[0000] failed to cleanup ipc mounts:
failed to umount /var/lib/docker/containers/8564990571b56c26f32872031507e77f786b870b27ed3f0b80eebe127ce65164/shm: invalid argument 
WARN[0000] libcontainerd: client is out of sync, restore was called on a fully synced container (c997c7c33a57163106e3de4c470a5f0e5bd3d030c259e62a9d6ea8c292e3551f). 
WARN[0000] libcontainerd: failed to retrieve container c997c7c33a57163106e3de4c470a5f0e5bd3d030c259e62a9d6ea8c292e3551f state: rpc error: code = 2 desc = containerd: container not found 
WARN[0000] failed to cleanup ipc mounts:
failed to umount /var/lib/docker/containers/c997c7c33a57163106e3de4c470a5f0e5bd3d030c259e62a9d6ea8c292e3551f/shm: invalid argument 
WARN[0000] libcontainerd: client is out of sync, restore was called on a fully synced container (28c274e176c9c112f8bc73f6916860665c63f1407ca2670944deee7b6ae2e747). 
WARN[0000] libcontainerd: failed to retrieve container 28c274e176c9c112f8bc73f6916860665c63f1407ca2670944deee7b6ae2e747 state: rpc error: code = 2 desc = containerd: container not found 
WARN[0000] failed to cleanup ipc mounts:
failed to umount /var/lib/docker/containers/28c274e176c9c112f8bc73f6916860665c63f1407ca2670944deee7b6ae2e747/shm: invalid argument 
WARN[0000] libcontainerd: client is out of sync, restore was called on a fully synced container (cca4cbbfb9970b29a26f6cc06622311c0ac789a729810529f35160f742e96c50). 
WARN[0000] libcontainerd: failed to retrieve container cca4cbbfb9970b29a26f6cc06622311c0ac789a729810529f35160f742e96c50 state: rpc error: code = 2 desc = containerd: container not found 
WARN[0000] failed to cleanup ipc mounts:
failed to umount /var/lib/docker/containers/cca4cbbfb9970b29a26f6cc06622311c0ac789a729810529f35160f742e96c50/shm: invalid argument 
WARN[0000] libcontainerd: client is out of sync, restore was called on a fully synced container (fa2937c2ca6cef38dea9de80b68c9a68497739c391393132870e9c6c295ee72b). 
WARN[0000] libcontainerd: failed to retrieve container fa2937c2ca6cef38dea9de80b68c9a68497739c391393132870e9c6c295ee72b state: rpc error: code = 2 desc = containerd: container not found 
WARN[0000] failed to cleanup ipc mounts:
failed to umount /var/lib/docker/containers/fa2937c2ca6cef38dea9de80b68c9a68497739c391393132870e9c6c295ee72b/shm: invalid argument 
WARN[0000] libcontainerd: client is out of sync, restore was called on a fully synced container (b8335587ad37a36a35fc2f1eb57b3b3d91f61af75262eb075b9045664885ee30). 
WARN[0000] libcontainerd: failed to retrieve container b8335587ad37a36a35fc2f1eb57b3b3d91f61af75262eb075b9045664885ee30 state: rpc error: code = 2 desc = containerd: container not found 
WARN[0000] failed to cleanup ipc mounts:
failed to umount /var/lib/docker/containers/b8335587ad37a36a35fc2f1eb57b3b3d91f61af75262eb075b9045664885ee30/shm: invalid argument 
WARN[0001] libcontainerd: client is out of sync, restore was called on a fully synced container (40d2418b6741c35dd249d5e4c7aefd248fa6f0efa25d7578f81fff06aea93d3b). 
WARN[0001] libcontainerd: failed to retrieve container 40d2418b6741c35dd249d5e4c7aefd248fa6f0efa25d7578f81fff06aea93d3b state: rpc error: code = 2 desc = containerd: container not found 
WARN[0001] failed to cleanup ipc mounts:
failed to umount /var/lib/docker/containers/40d2418b6741c35dd249d5e4c7aefd248fa6f0efa25d7578f81fff06aea93d3b/shm: invalid argument

lsb_release -a

LSB Version:    core-9.20160110ubuntu5-amd64:core-9.20160110ubuntu5-noarch:security-9.20160110ubuntu5-amd64:security-9.20160110ubuntu5-noarch
Distributor ID: Ubuntu
Description:    Ubuntu 17.04
Release:    17.04
Codename:   zesty

我该如何纠正这个问题?

答案1

看起来您当前的内核不支持 Docker 所需的 Cgroups 功能。您使用的是 Debian 吗?无论如何,这些警告表明无法对 Docker 容器应用内存、CPU 和交换限制。如果您想要/需要它们,您应该更新内核。

答案2

在 Xenial 上也遇到了同样的问题,我正准备根据 docker 的需求重新编译内核,但没有发现当前配置中任何开关被停用,正如它声称的那样。结果:一旦我删除(--purge)所有 docker 数据包(包括 cgroupfs-mount 和 aufs-tools),并再次安装完全相同版本的 docker,它就可以正常工作了。猜测这是由某些所需数据包的详细信息中的某些内容引起的。够奇怪的了。

相关内容