After deployment Prometheus
, it needs to be installed on the server to be detectedNode Exporter
Prometheus Node Exporter
Various hardware and kernel related metrics are exposed.
Usually Prometheus
through Node Exporter
to monitor various information of the system.
Installation
First you need to download the Node binary package from the downloads page
After getting the link address, connect to the Linux system, here we take it as Ubuntu
an example.
# 可以在/opt 或者/usr/local/bin 目录安装,这了我们选择 /usr/local/bin
# 复制刚才的连接
sudo wget https://github.com/prometheus/node_exporter/releases/download/v1.5.0/node_exporter-1.5.0.linux-amd64.tar.gz
sudo tar xvfz node_exporter-*.*-amd64.tar.gz
cd node_exporter-*.*-amd64
# 运行 node
./node_exporter
If you see the running log, it means success
Service
Usually, it needs to Node
be set to run permanently in the background. You can use screen or make it Node
into a service. Here we choose the service
- Will
Node
move to the /usr/local/bin directory.
sudo cp node_exporter-*.*-amd64/node_exporter /usr/local/bin/
cd /usr/local/bin
ls
# node_exporter ......
- Create a
systemd service
configuration file./etc/systemd/system/
Anode_exporter.service
file named
cd /etc/systemd/system/
sudo touch node_exporter.service
sudo vim node_exporter.service
and copy the following into that file:
[Unit]
Description=Node Exporter
[Service]
User=root
Group=root
Restart=always
ExecStart=/usr/local/bin/node_exporter
[Install]
WantedBy=default.target
- After saving the file, reload the daemon and start
node_exporter
the service and enable it to start automatically on system boot
sudo systemctl daemon-reload
sudo systemctl enable node_exporter
sudo systemctl start node_exporter
- Check the service running log
journalctl -u node_exporter.service
As shown in the figure, it is normal startup.
open port
Node_Exporter
The port is used by default 9100
, and its port needs to be opened for Prometheus
access, which can be set in the security group