运行docker监控容器cadvisor的时候提示如下错误
Dec 13 17:36:39 prd_java-cc8 dockerd-current[2586]: W1213 17:36:39.185606 1 manager.go:349] Could not configure a source for OOM detection, disabling OOM events: open /dev/kmsg: no such file or directory
Dec 13 17:36:39 prd_java-cc8 dockerd-current[2586]: F1213 17:36:39.252012 1 cadvisor.go:172] Failed to start container manager: inotify_add_watch /sys/fs/cgroup/cpuacct,cpu: no such file or directory
Dec 13 17:36:39 prd_java-cc8 dockerd-current[2586]: time="2021-12-13T17:36:39.432483334+08:00" level=warning msg="f9d2bf4404dbe433d4fe063483b63f7d3e6222b79e538a66f3a4e92ef2331d68 cleanup: failed to unmount secrets: invalid argument"
解决办法
mount -o remount,rw '/sys/fs/cgroup/'
ln -s /sys/fs/cgroup/cpu,cpuacct /sys/fs/cgroup/cpuacct,cpu
mount -o remount,ro '/sys/fs/cgroup/'