JDK进程查看jps工具(jpsx)
cd /usr/local/bin
sudo vi jpsx
脚本内容如下:
#!/bin/bash
# 检查集群进程状态
for i in bigdata-node1 bigdata-node2 bigdata-node3
do
echo ------------------- $i --------------
ssh $i "source /etc/profile;/home/vagrant/modules/jdk1.8.0_221/bin/jps"
done
设置脚本执行权限:
sudo chmod +x jpsx
sudo chown vagrant:vagrant jpsx
分发(选做):
# 使用root账户分发至其他节点
sudo scp -r /usr/local/bin/jpsx root@bigdata-node2:/usr/local/bin/
sudo scp -r /usr/local/bin/jpsx root@bigdata-node3:/usr/local/bin/