diff options
author | david <snarlysodboxer@users.noreply.github.com> | 2017-11-02 04:07:40 -0700 |
---|---|---|
committer | Johannes 'fish' Ziemke <github@freigeist.org> | 2017-11-02 12:07:40 +0100 |
commit | eb3a917bd8f414e4e2f0803f715bc3ebfba8efae (patch) | |
tree | 4eae1d860938eb6e39f4ac6e86cf217c1cc5ad8a | |
parent | defe2f373ccbdcc71fdbe8b2a2b84c379c30bc7d (diff) | |
download | prometheus_node_collector-eb3a917bd8f414e4e2f0803f715bc3ebfba8efae.tar.bz2 prometheus_node_collector-eb3a917bd8f414e4e2f0803f715bc3ebfba8efae.tar.xz prometheus_node_collector-eb3a917bd8f414e4e2f0803f715bc3ebfba8efae.zip |
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
-rw-r--r-- | README.md | 34 |
1 files changed, 5 insertions, 29 deletions
@@ -166,40 +166,16 @@ To see all available configuration flags: | |||
166 | ## Using Docker | 166 | ## Using Docker |
167 | The node\_exporter is designed to monitor the host system. It's not recommended | 167 | The node\_exporter is designed to monitor the host system. It's not recommended |
168 | to deploy it as Docker container because it requires access to the host system. | 168 | to deploy it as Docker container because it requires access to the host system. |
169 | If you need to run it on Docker, you can deploy this exporter using the | 169 | Be aware that any non-root mount points you want to monitor will need bind-mounted |
170 | [node-exporter Docker | 170 | into the container. |
171 | image](https://quay.io/repository/prometheus/node-exporter) with the following | ||
172 | options and bind-mounts: | ||
173 | 171 | ||
174 | for docker version >= 1.10 | ||
175 | ```bash | 172 | ```bash |
176 | docker run -d -p 9100:9100 \ | 173 | docker run -d \ |
177 | -v "/proc:/host/proc:ro" \ | ||
178 | -v "/sys:/host/sys:ro" \ | ||
179 | -v "/:/rootfs:ro,rslave" \ | ||
180 | --net="host" \ | 174 | --net="host" \ |
181 | quay.io/prometheus/node-exporter \ | 175 | --pid="host" \ |
182 | --path.procfs /host/proc \ | 176 | quay.io/prometheus/node-exporter |
183 | --path.sysfs /host/sys \ | ||
184 | --collector.filesystem.ignored-mount-points "^/(sys|proc|dev|host|etc)($|/)" | ||
185 | ``` | 177 | ``` |
186 | 178 | ||
187 | for docker version < 1.10 | ||
188 | ```bash | ||
189 | docker run -d -p 9100:9100 \ | ||
190 | -v "/proc:/host/proc:ro" \ | ||
191 | -v "/sys:/host/sys:ro" \ | ||
192 | -v "/:/rootfs:ro" \ | ||
193 | --net="host" \ | ||
194 | quay.io/prometheus/node-exporter \ | ||
195 | --path.procfs /host/proc \ | ||
196 | --path.sysfs /host/sys \ | ||
197 | --collector.filesystem.ignored-mount-points "^/(sys|proc|dev|host|etc)($|/)" | ||
198 | ``` | ||
199 | |||
200 | Be aware though that the mountpoint label in various metrics will now have | ||
201 | `/rootfs` as prefix. | ||
202 | |||
203 | ## Using a third-party repository for RHEL/CentOS/Fedora | 179 | ## Using a third-party repository for RHEL/CentOS/Fedora |
204 | 180 | ||
205 | There is a [community-supplied COPR repository](https://copr.fedorainfracloud.org/coprs/ibotty/prometheus-exporters/). It closely follows upstream releases. | 181 | There is a [community-supplied COPR repository](https://copr.fedorainfracloud.org/coprs/ibotty/prometheus-exporters/). It closely follows upstream releases. |