介绍
MESH-PLATFORM
后端项目运行/部署
1:项目准备
- 从 Git 获取代码
bash
# 克隆代码
git clone http://192.168.0.7:9980/product/platform/pc/mesh-platform.git
2:打包
- 打包
bash
mvn clean package
3:运行
- 直接命令运行
bash
java -jar ${模块名称JAR名称} ${运行参数}
# 例如:java -jar mesh-gateway.jar -XX:+UseG1GC -Xms512m -Xmx2G -Xmn768m
- Linux后台运行
bash
# 有日志输出
nohup java -jar ${模块名称JAR名称} ${运行参数} > ${日志路径}/${日志名称}.log 2>&1 &
# 无日志输出
nohup java -jar ${模块名称JAR名称} ${运行参数} > /dev/null 2>&1 &
# 例如:nohup java -jar mesh-gateway.jar -XX:+UseG1GC -Xms512m -Xmx2G -Xmn768m > /opt/mesh-gateway.log 2>&1 &
- 脚本运行
bash
# 需要将项目模块jar文件与项目/build/script/shell/run.sh文件放在同一目录下
bash run.sh start ${模块名称}
# 例如:run.sh start mesh-gateway
# run.sh 命令包含 start stop copy