node_exporter无法启动处理

客户告警node_exporter down了,9100和9115端口都down了

$ cd /home/tidb/deploy/scripts/
 $ ll
total 8
-rwxr-xr-x 1 tidb tidb 501 Jul 26 14:53 run_blackbox_exporter.sh
-rwxr-xr-x 1 tidb tidb 652 Jul 26 14:53 run_node_exporter.sh

启动blackbox_exporter脚本

nohup sh run_blackbox_exporter.sh &

这时候9115端口已经启动了,9100端口并没有启动

直接执行脚本并不行,我在4版本和6.1版本测试执行这个脚本都会报错

$ sh  run_node_exporter.sh
run_node_exporter.sh: line 9: syntax error near unexpected token `>'

这时候node_exporter需要用systemctl才能启动

$ sudo systemctl list-units |grep export


 
$ sudo systemctl start node_exporter-9100.service
Warning: node_exporter-9100.service changed on disk. Run 'systemctl daemon-reload' to reload units.
 
$ sudo systemctl  daemon-reload node_exporter-9100.service
Invalid number of arguments.

$ sudo systemctl list-units |grep export
  node_exporter-9100.service                                                          loaded active running   node_exporter service

$ sudo netstat -nalp|grep 9100
tcp6       0      0 :::9100                 :::*                    LISTEN      134884/bin/node_exp 
tcp6       0      0 10.102.6.252:9100       10.102.6.76:57154       ESTABLISHED 134884/bin/node_exp 
 
$ sudo netstat -nalp|grep 9115
tcp6       0      0 :::9115                 :::*                    LISTEN      132305/bin/blackbox 
tcp6       0      0 10.102.6.252:9115       10.102.6.76:38152       ESTABLISHED 132305/bin/blackbox 

启动命令如下 :
1.
sudo systemctl daemon-reload blackbox_exporter-9115

sudo systemctl start blackbox_exporter-9115

sudo systemctl start node_exporter-9100.service

sudo systemctl daemon-reload node_exporter-9100.service

你可能感兴趣的:(tidb,linux,运维,网络)