Could not configure a source for OOM detection, disabling OOM events: open /dev/kmsg: no such file or directory

运行命令

docker run -d -p 8090:8080 --name cadvisor -v /:/rootfs:ro -v /var/run:/var/run:rw -v /sys:/sys:ro -v /var/lib/docker/:/var/lib/docker:ro google/cadvisor:latest

使用docker logs 查看你日志有以下错误:

只有这一行错误,没别的信息

[root@infra ~]# docker logs -f  bec5170f382d
W1111 03:06:47.818365       1 manager.go:349] Could not configure a source for OOM detection, disabling OOM events: open /dev/kmsg: no such file or directory

解决

使用特权模式运行,加上: --privileged=true

docker run -d -p 8090:8080 --name cadvisor  --privileged=true -v /:/rootfs:ro -v /var/run:/var/run:rw -v /sys:/sys:ro -v /var/lib/docker/:/var/lib/docker:ro google/cadvisor:latest

https://github.com/google/cadvisor/issues/2150

 

有的服务器需要这个命令运行(不知道为啥。没有研究过)

   docker run -d \
   -p 8090:8080 \
    --name cadvisor  \
    --privileged=true \
    -v /:/rootfs:ro \
    -v /var/run:/var/run:rw \
    -v /var/lib/docker/:/var/lib/docker:ro \
    -v /sys/fs/cgroup/cpu,cpuacct:/sys/fs/cgroup/cpuacct,cpu \
    google/cadvisor:latest

 

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐