spring boot application in cluster

mahendra kawde picture mahendra kawde · Oct 5, 2015 · Viewed 18.4k times · Source

I am developing a spring boot application.

Since spring boot created a .jar file for an application. I want to cluster this particular application on different server. Lets say I build a jar file and ran a project then it should run in cluster mode from number of defined servers and should be able to serve end user needs.

My jar will reside on only one server but it will be clustered across number of servers. When end user calls a web service from my spring boot app he never know from where it is getting called.

The reason behind clustering is suppose any of the server goes down in future, end user will still be able to access web services from another server. But I don't know how to make it clustered.

Can any one please give me insight on this ?

Answer

dunni picture dunni · Oct 5, 2015

If you want to have it clustered, you just run your Spring Boot application on multiple servers (of course, the JAR must be present on those servers, otherwise you can't run it). You would then place a loadbalancer in front of the application servers to distribute the load.