Cadvisor: Could not configure a source for OOM detection, disabling OOM events

Created on 18 Jan 2019  路  11Comments  路  Source: google/cadvisor

rancher1.6

Ubuntu 16.04.2
4.4.0-62-generic
Docker version 17.12.1-ce, build 7390fc6
google/cadvisor:v0.32.0

volumn:
"/:/rootfs:ro",
"/var/run:/var/run:rw",
"/sys:/sys:ro",
"/var/lib/docker/:/var/lib/docker:ro",
"rancher-cni:/.r:ro"

logs:
2019/1/18 涓嬪崍6:12:08W0118 10:12:08.685620 1 manager.go:349] Could not configure a source for OOM detection, disabling OOM events: open /dev/kmsg: no such file or directory

Most helpful comment

Run the cadvisor container with privileged: true

All 11 comments

maybe you need to mount /dev/kmsg into the container?

Tried that, same outcome. Tried it RO and RW.

Run the cadvisor container with privileged: true

@tommmlij That was working for me.

@wongchao 鎴戜篃閬囧埌鍚屾牱鐨勯棶棰橈紝浣犺В鍐充簡鍚楋紵

privileged: true does not resolve it on Centos 7.7

Metrics flow and work without privileged, but following running instructions results in Could not configure a source for OOM detection, disabling OOM events: open /dev/kmsg: no such file or directory
Mounting /dev instead of /dev/disk changes it to Could not configure a source for OOM detection, disabling OOM events: open /dev/kmsg: operation not permitted
Turning privileged on/off does not seem to affect it in any way.

edit: well, found something. Even though compose reference mentions it, and the feature exists, it is still not merged, so swarm does not yet support privileged https://github.com/docker/swarmkit/issues/1030

Probably better to use --device tag to mount device into container than using privileged...

Run the cadvisor container with privileged: true

How do I run it as privileged? I am already running it as sudo.

@dashpole Do you think that we should add --privileged to example command of running cAdvisor in docker in https://github.com/google/cadvisor/blob/master/README.md?

I see that issue don't appear if /dev/kmsg is added to container, for example:

VERSION=v0.35.0 # use the latest release version from https://github.com/google/cadvisor/releases
sudo docker run \
  --volume=/:/rootfs:ro \
  --volume=/var/run:/var/run:ro \
  --volume=/sys:/sys:ro \
  --volume=/var/lib/docker/:/var/lib/docker:ro \
  --volume=/dev/disk/:/dev/disk:ro \
  --publish=8080:8080 \
  --name=cadvisor \
  --device=/dev/kmsg \
  gcr.io/google-containers/cadvisor:$VERSION
Was this page helpful?
0 / 5 - 0 ratings