#!/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