linux中shell脚本启动和停止jar包程序性模版

#!/bin/bash

app=gmail0808
port=8080

case $1 in
 "start") {
 for i in hadoop1 hadoop2 hadoop3
 do
   ssh $i "java -jar /applog/gmail0808/"$app"-logger-0.0.1-SNAPSHOT.jar --server.port=$port > /dev/null 2>&1 &"
 done

};;

"stop") {
 for i in haoop1 hadoop2 hadoop3
 do
   ssh $i "ps -ef|grep "$app"-logger|grep -v grep|awk '{print \$2}'|xargs kill"
 done
};;

esac

 

上一篇:Hbase 安装


下一篇:无法连接到Cassandra:java.lang.NoSuchMethodError:com.google.common.util.concurrent.Futures.withFallback