英文:
process manager for JAVA Jar Files for hosting
问题
我想将我的Java Spring后端部署到AWS。
我找到了在AWS上部署jar文件的方法。但问题是,一旦我终止终端部署就会停止。我在构建时创建了一个jar文件,并通过复制jar文件到AWS EC2 Linux实例上,并运行以下命令来托管它。
java -jar jarfile
我希望这个部署是持久的。是否有类似于Node.js中的pm2的工具适用于Java,以便我可以永久地运行这个jar文件?
谢谢帮助。
英文:
I want to deploy my java spring backend to AWS .
I figured the way to deploy jar file on aws. But the problem is as soon as I terminate the terminal deployment stops. I created a jar file on build and hosted on aws EC2 linux Instance by copying jar file there and running below command .
java -jar jarfile
I want this deployment to be persistent. Is there any tool similar to pm2 for nodeJs in JAVA so that I can run this jar file permanently. ?
Thanks for help.
答案1
得分: 0
你应该使用nohup来部署jar文件。即使你关闭终端,它也会继续运行。
例如:nohup java -jar javaservice.jar > nohup.log &
英文:
You should use nohup to deploy jar file. It will run even though you close terminal
E.g:- nohup java -jar javaservice.jar > nohup.log &
专注分享java语言的经验与见解,让所有开发者获益!
评论