Reputation: 117
I have 3 spring boot application and want to deploy all on single EC2 instance.
When i have tried to deploy war and deploy under tomcat/webapps some applications will not work as embedded tomcat in spring boot uses port 8080 and other web applications which are exists in tomcat stopped working.
Other options i have tried is changing server.port in application.properties file running jar with java -jar app.jar.
This works but for only one app if i want to run one app and if i press cntrl+c or cntrl+z or closing terminal(closing ssh connection) is stopping application.
When found during my search that we can do with AWS Elastic Beanstalk.but i have already created one free tier ec2 instance is there any way to make it work with out changing instance.
can some one help me out? Thanks
Upvotes: 0
Views: 1117
Reputation: 291
If you want to run your app using java -jar app.jar
add &
to the end allowing the process to run in the background.
Using the command java -jar app.jar &
you can run multiple apps in the background. This will return a pid "Process ID"
You can use this pid to kill the app later with kill -9 <pid>
To check running processes you can use ps aux | grep java
(We are searching for anything that contains "java")
For running multiple wars on tomcat explicitly deploying multiple applications to Tomcat
Upvotes: 1