部署命令
docker run -d --name node-exporter -v /proc:/host/proc -v /sys:/host/sys -v /:/rootfs quay.io/prometheus/node-exporter:v0.18.1 --path.procfs /host/proc --path.sysfs /host/sys --collector.filesystem.ignored-mount-points="^/(sys|proc|dev|host|etc)($|/)"
报错
ERROR: timex collector failed after 0.000081s: failed to retrieve adjtimex stats: operation not permitted" source="collector.go:132
解决
需要给docker添加参数--cap-add=SYS_TIME
https://github.com/prometheus/node_exporter/issues/835
https://github.com/prometheus/node_exporter/blob/master/README.md#using-docker
docker run -d --name node-exporter \
--cap-add=SYS_TIME \
-v /proc:/host/proc \
-v /sys:/host/sys \
-v /:/rootfs \
quay.io/prometheus/node-exporter:v0.18.1 \
--path.procfs /host/proc \
--path.sysfs /host/sys \
--collector.filesystem.ignored-mount-points="^/(sys|proc|dev|host|etc)($|/)"