退出腻子后如何使springboot应用程序保持活动状态

问题描述:

我通过命令使用 putty 在我的服务器上运行我的 Spring Boot 应用程序mvn spring-boot:run 它仅在我打开 ssh 会话时运行.断开会话后是否可以使应用程序保持活动状态?或者我是否必须制作可执行的war文件并部署到我的ubunntu 14.04上安装的tomcat服务器.我知道部署启动应用程序的其他方法,但我想知道我的方法是否可行.

I am running my spring boot application on my server using putty via command mvn spring-boot:run and it runs only when I have open ssh session. Is it possible to keep application alive after I disconnect session? Or do I have to make executable war file and deploy to installed tomcat server on my ubunntu 14.04. I know others ways to deploy boot apps but I want to know if it is possible in my approach.

你可以在后台运行命令,像这样使用 nohup

You can run the command in the background and with nohup like so

nohup mvn spring-boot:run &

nohup mvn spring-boot:run &

执行此操作时,即使关闭 ssh 会话,应用程序也会在后台运行.

When you do this, the application runs in background even after you close ssh session.