How to turn the exporter corresponding to Prometheus into a system service
This article introduces the relevant knowledge of "how to make the exporter corresponding to Prometheus into a system service". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Here we take node_exporter as an example to introduce this process. The function of node_exporter is to collect machine system data and monitor server CPU, memory, disk, Ibank O and other information.
1. Download and decompress wget https://github.com/prometheus/node_exporter/releases/download/v1.0.1/node_exporter-1.0.1.linux-amd64.tar.gztar zxvf node_exporter-1.0.1.linux-amd64.tar.gzmv node_exporter-1.0.1.linux-amd64 / usr/local/node_exporter2, create user groupadd prometheususeradd-g prometheus-m-d / var/lib/prometheus-s / sbin/nologin prometheuschown prometheus.prometheus-R / usr/local/node_exporter3, Create a Systemd service cat > / etc/systemd/system/node_exporter.service