11. Node_exporter 一篇就够

2022-06-28  本文已影响0人  starQuest

11.1解压安装

tar -zxvf node_exporter-0.18.1.linux-amd64.tar.gz

groupadd prometheus2

useradd -g prometheus2 -m -d /home/monitor/node_exporter/ -s /sbin/nologin prometheus2

mv node_exporter-0.18.1.linux-amd64 node_exporter

rm -rf node_exporter-0.18.1.linux-amd64

11.2自启动

touch /usr/lib/systemd/system/node_exporter.service

chown prometheus2:prometheus2 /usr/lib/systemd/system/node_exporter.service

chown -R prometheus2:prometheus2 /home/monitor/node_exporter

vim /usr/lib/systemd/system/node_exporter.service

配置

[Unit]

Description=node_exporter

After=network.target

[Service]

Type=simple

User=prometheus2

ExecStart=/home/monitor/node_exporter/node_exporter

Restart=on-failure

[Install]

WantedBy=multi-user.target

启动

systemctl daemon-reload

systemctl enable node_exporter.service

systemctl start node_exporter.service

systemctl status node_exporter.service

systemctl stop node_exporter.service

systemctl restart node_exporter.service

11.3节点配置到Prometheus

image.png

scrape_configs:

The job name is added as a label job=<job_name> to any timeseries scraped from this config.

metrics_path defaults to '/metrics'

# scheme defaults to 'http'.

static_configs:

新添加的对其它node节点抓取数据

static_configs:

linux选择模板9276

上一篇 下一篇

猜你喜欢

热点阅读