diff options
author | Yecheng Fu <cofyc.jackson@gmail.com> | 2018-10-04 20:11:21 +0800 |
---|---|---|
committer | Ben Kochie <superq@gmail.com> | 2018-10-04 14:11:21 +0200 |
commit | 0f9842f20a036d2db8f29102e6bc0cd7b1672865 (patch) | |
tree | b6b8451169448d437f82d13c7020c25ddd51edc5 /README.md | |
parent | 2269df255c8627f819afd3d2d6bb99d809b2ac9c (diff) | |
download | prometheus_node_collector-0f9842f20a036d2db8f29102e6bc0cd7b1672865.tar.bz2 prometheus_node_collector-0f9842f20a036d2db8f29102e6bc0cd7b1672865.tar.xz prometheus_node_collector-0f9842f20a036d2db8f29102e6bc0cd7b1672865.zip |
[continue 912] strip rootfs prefix for run in docker (#1058)
* strip rootfs prefix for run in docker
* Use `/` as default value of path.rootfs, and parse mounts from `/proc/1/mounts`.
* No need to mount `/proc` and `/sys` because we share host's PID
namespace, which allows processes within the container to see all of the
processes on the system.
Closes: #66
Signed-off-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
Signed-off-by: Yecheng Fu <cofyc.jackson@gmail.com>
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -144,12 +144,17 @@ The `node_exporter` is designed to monitor the host system. It's not recommended | |||
144 | to deploy it as a Docker container because it requires access to the host system. | 144 | to deploy it as a Docker container because it requires access to the host system. |
145 | Be aware that any non-root mount points you want to monitor will need to be bind-mounted | 145 | Be aware that any non-root mount points you want to monitor will need to be bind-mounted |
146 | into the container. | 146 | into the container. |
147 | If you start container for host monitoring, specify `path.rootfs` argument. | ||
148 | This argument must match path in bind-mount of host root. The node\_exporter will use | ||
149 | `path.rootfs` as prefix to access host filesystem. | ||
147 | 150 | ||
148 | ```bash | 151 | ```bash |
149 | docker run -d \ | 152 | docker run -d \ |
150 | --net="host" \ | 153 | --net="host" \ |
151 | --pid="host" \ | 154 | --pid="host" \ |
152 | quay.io/prometheus/node-exporter | 155 | -v "/:/host:ro,rslave" \ |
156 | quay.io/prometheus/node-exporter \ | ||
157 | --path.rootfs /host | ||
153 | ``` | 158 | ``` |
154 | 159 | ||
155 | On some systems, the `timex` collector requires an additional Docker flag, | 160 | On some systems, the `timex` collector requires an additional Docker flag, |