mirror of
https://github.com/prometheus/node_exporter.git
synced 2024-12-28 23:19:46 -08:00
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
This commit is contained in:
parent
defe2f373c
commit
eb3a917bd8
34
README.md
34
README.md
|
@ -166,40 +166,16 @@ To see all available configuration flags:
|
||||||
## Using Docker
|
## Using Docker
|
||||||
The node\_exporter is designed to monitor the host system. It's not recommended
|
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.
|
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
|
Be aware that any non-root mount points you want to monitor will need bind-mounted
|
||||||
[node-exporter Docker
|
into the container.
|
||||||
image](https://quay.io/repository/prometheus/node-exporter) with the following
|
|
||||||
options and bind-mounts:
|
|
||||||
|
|
||||||
for docker version >= 1.10
|
|
||||||
```bash
|
```bash
|
||||||
docker run -d -p 9100:9100 \
|
docker run -d \
|
||||||
-v "/proc:/host/proc:ro" \
|
|
||||||
-v "/sys:/host/sys:ro" \
|
|
||||||
-v "/:/rootfs:ro,rslave" \
|
|
||||||
--net="host" \
|
--net="host" \
|
||||||
quay.io/prometheus/node-exporter \
|
--pid="host" \
|
||||||
--path.procfs /host/proc \
|
quay.io/prometheus/node-exporter
|
||||||
--path.sysfs /host/sys \
|
|
||||||
--collector.filesystem.ignored-mount-points "^/(sys|proc|dev|host|etc)($|/)"
|
|
||||||
```
|
```
|
||||||
|
|
||||||
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
|
## 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.
|
There is a [community-supplied COPR repository](https://copr.fedorainfracloud.org/coprs/ibotty/prometheus-exporters/). It closely follows upstream releases.
|
||||||
|
|
Loading…
Reference in a new issue