#!/bin/bash
#程序运行时目录
server_dir=/opt/xzff/project/bigdata1/
ps -ef |grep java |grep feifan-bd-9888 |grep -v 'grep'|awk '{print $2}' | xargs kill -9
cp $server_dir"bigdata-system-2.6.jar" $server_dir"feifan-bd-9888.jar"
nohup java -Xmx256m -Xms256m -Xss512k -jar $server_dir"feifan-bd-9888.jar" --server.port=9888 --spring.profiles.active=prod > $server_dir"/logs/9888.out" &
#sleep 60s
#ps -ef |grep java |grep feifan-exam-9003 |grep -v 'grep'|awk '{print $2}' | xargs kill -9
#cp $server_dir"feifan-exam-0.0.1-SNAPSHOT.jar" $server_dir"feifan-exam-9003.jar"
#nohup java -Xmx512m -Xms256m -Xss256k -jar $server_dir"feifan-exam-9003.jar" --server.port=9003 --spring.profiles.active=prd > $server_dir"/logs/9003.out" &
server_dir下创建logs否则会找不到
保存为start.sh 执行
chmod 777 ./start.sh
获取权限 执行./start.sh