Skip to content
Snippets Groups Projects
Commit eb3a917b authored by david's avatar david Committed by Johannes 'fish' Ziemke
Browse files

Use host PID namespace in docker example (#672)

* Use host PID namespace in docker example

See https://github.com/prometheus/node_exporter/issues/671

* Update readme for readability

* Fix comments in readme
parent defe2f37
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -166,40 +166,16 @@ To see all available configuration flags:
## Using Docker
The node\_exporter is designed to monitor the host system. It's not recommended
to deploy it as Docker container because it requires access to the host system.
If you need to run it on Docker, you can deploy this exporter using the
[node-exporter Docker
image](https://quay.io/repository/prometheus/node-exporter) with the following
options and bind-mounts:
Be aware that any non-root mount points you want to monitor will need bind-mounted
into the container.
 
for docker version >= 1.10
```bash
docker run -d -p 9100:9100 \
-v "/proc:/host/proc:ro" \
-v "/sys:/host/sys:ro" \
-v "/:/rootfs:ro,rslave" \
docker run -d \
--net="host" \
quay.io/prometheus/node-exporter \
--path.procfs /host/proc \
--path.sysfs /host/sys \
--collector.filesystem.ignored-mount-points "^/(sys|proc|dev|host|etc)($|/)"
--pid="host" \
quay.io/prometheus/node-exporter
```
 
for docker version < 1.10
```bash
docker run -d -p 9100:9100 \
-v "/proc:/host/proc:ro" \
-v "/sys:/host/sys:ro" \
-v "/:/rootfs:ro" \
--net="host" \
quay.io/prometheus/node-exporter \
--path.procfs /host/proc \
--path.sysfs /host/sys \
--collector.filesystem.ignored-mount-points "^/(sys|proc|dev|host|etc)($|/)"
```
Be aware though that the mountpoint label in various metrics will now have
`/rootfs` as prefix.
## Using a third-party repository for RHEL/CentOS/Fedora
 
There is a [community-supplied COPR repository](https://copr.fedorainfracloud.org/coprs/ibotty/prometheus-exporters/). It closely follows upstream releases.
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment