参考小菠萝博客笔记:https://www.cnblogs.com/poloyy/p/12375039.html
小菠萝是在一个服务器上面装的,我是2个服务器分别装的,下面需要新增一个命令:
useradd prometheus
NODE_PATH='/data/prometheus/node_exporter/'
cd /usr/local/src/
mkdir -p ${NODE_PATH}
wget https://github.com/prometheus/node_exporter/releases/download/v0.18.0/node_exporter-0.18.0.linux-amd64.tar.gz
tar -xvf node_exporter-0.18.0.linux-amd64.tar.gz
cp node_exporter-0.18.0.linux-amd64/node_exporter ${NODE_PATH}
chown -R prometheus.prometheus ${NODE_PATH}
NODE_PATH='/data/prometheus/node_exporter/' cd /usr/local/src/ mkdir -p ${NODE_PATH} wget https://github.com/prometheus/node_exporter/releases/download/v0.18.0/node_exporter-0.18.0.linux-amd64.tar.gz tar -xvf node_exporter-0.18.0.linux-amd64.tar.gz cp node_exporter-0.18.0.linux-amd64/node_exporter ${NODE_PATH} chown -R prometheus.prometheus ${NODE_PATH}
cat > /lib/systemd/system/node_exporter.service <<EOF [Unit] Description=node_exporter Documentation=https://prometheus.io/ After=network.target [Service] Type=simple User=prometheus ExecStart=/data/prometheus/node_exporter/node_exporter Restart=on-failure [Install] WantedBy=multi-user.target EOF
systemctl daemon-reload systemctl enable node_exporter.service systemctl start node_exporter.service systemctl status node_exporter.service
http://47.120.61.196:9100/metrics
标签:Node,node,exporter,NODE,性能,prometheus,测试,linux,PATH From: https://www.cnblogs.com/xiaobaibailongma/p/18147692