Node_exporter: mount error by running node-exporter by docker

Created on 23 Jan 2019  路  1Comment  路  Source: prometheus/node_exporter

Host operating system: output of uname -a

Linux secscada 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

node_exporter version: output of node_exporter --version

node_exporter, version 0.17.0 (branch: HEAD, revision: f6f6194a436b9a63d0439abc585c76b19a206b21)
build user: root@322511e06ced
build date: 20181130-15:51:33
go version: go1.11.2

Ps: Node-exporter is running by docker
and Node-exporter is installed by

sudo docker pull prom/node-exporter

the version info is showed by

sudo docker run    prom/node-exporter      --version

node_exporter command line flags

I don't understand what command line flags is ?

Are you running node_exporter in Docker?


yes

What did you do that produced an error?

I am trying to run node-exporter as below:

sudo docker run         \
--network="host"            \
--pid="host"            \
-v "/:/host:ro,rslave"  \
prom/node-exporter      \
--path.rootfs="/host"

What did you expect to see?

node-exporter running

What did you see instead?

error info is as below

docker: Error response from daemon: linux mounts: Path / is mounted on / but it is not a shared or slave mount..

Most helpful comment

it seems casued by old version of docker .
and the solution is to run

 sudo docker run         \
--network="host"            \
--pid="host"            \
-v "/:/host:ro"  \
prom/node-exporter      \
--path.rootfs="/host"

>All comments

it seems casued by old version of docker .
and the solution is to run

 sudo docker run         \
--network="host"            \
--pid="host"            \
-v "/:/host:ro"  \
prom/node-exporter      \
--path.rootfs="/host"
Was this page helpful?
0 / 5 - 0 ratings