一、实现功能
在centos系统上部署java程序,有一些基本操作,在此总结。
二、具体操作
1.前台运行
java -jar demo.jar \ #指定jar包
–spring.config.location=/.../application.properties #指定配置文件目录
2.后台运行
nohup java -jar demo.jar \ #指定jar包
–spring.config.location=/.../application.properties \ #指定配置文件目录
> demo.out 2>&1 & #指定日志输出目录
3.查看日志
# tailf demo.out
4.查看相关进程
# ps -aux | grep demo
5.关闭相关进程
kill -9 ID