4
I wonder if we can deploy multiple springboot microservices in single EC2 instance.
I tried but It was creating new instance for every spring boot application.
For Example :
  • Add Service
  • Subtract Service
  • And Result service

    Do I need to create Three EC2 Instances to get the result in Result service. IF Yes It will cost a lot and how to reduce the cost of deployment in AWS cloud.

1 Answer 1

6

Locally, you can deploy multiple spring boot instances by running them on different ports. EC2 is no different. Just make sure they don't conflict on the same port and you should be able to do this.

Sign up to request clarification or add additional context in comments.

5 Comments

Does the People who go to aws cloud use the same trick ? To save expense of every single EC2 instance ?
Yes. You would have to get a loadbalancer that points to the correct application though. This should help you further: stackoverflow.com/questions/49437365/…
Thanks for the help ! I have one more doubt about docker ..... Can we deploy multiple different app for Ex: springboot1 and springboot2 in same docker or different docker.
Just like locally, you could run multiple instances on a single docker container. Depending on your use-case that might be helpful. But since docker containers are quite lightweight I think it would probably be easier to separate your concerns and run each application on its own container.
No problem, glad to help. Could you accept this answer as the correct answer?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.