一、jar包路径
二、
在/bin目录下创建logger.sh,并授予执行权限
vi logger.sh chmod 777 logger.sh
三、写logger.sh脚本
#!/bin/bash JAVA_BIN=/opt/module/jdk1.8.0_212/bin/java APPNAME=gmall-logger.jar case $1 in "start") { for i in hadoop102 hadoop103 hadoop104 do echo "========: $i===============" ssh $i "$JAVA_BIN -Xms32m -Xmx64m -jar /opt/module/gmall-flink/rt_applog/$APPNAME >/dev/null 2>&1 &" done };; "stop") { for i in hadoop102 hadoop103 hadoop104 do echo "========: $i===============" ssh $i "ps -ef|grep $APPNAME | grep -v grep|awk '{print \$2}'| xargs kill" >/dev/null 2>&1 done };; esac
四、启动群起脚本
/bin/logger.sh start
五、查看进程