vi /etc/systemd/system/node_exporter.service 

[Unit]
Description=node_exporter Monitoring System
Documentation=node_exporter Monitoring System
 
[Service]
ExecStart=/usr/local/script/node_exporter/node_exporter --web.listen-address=:9100
 
[Install]
WantedBy=multi-user.target 


 

#设置开机自启
systemctl daemon-reload
systemctl start node_exporter.service
systemctl status node_exporter.service
systemctl enable node_exporter.service