Reputation: 343
I have 3 Tomcat servers under a Load Balancer. Each of these servers have the same 3 war files. The Load balancer checks the health of the Tomcat server by checking if Tomcat is listening to port 8080, if it receives a successful response, routes the traffic to that Tomcat server.
Now issue is that when Tomcat is starting up, it responds success to the Load balancer port check, even before all the war files are deployed. So initial requests routed to the Tomcat Server result in 404 because the application has not yet been deployed.
Is there a way I can prevent Tomcat from responding success to Load balancer port check until after all the web applications have been deployed?
Upvotes: 1
Views: 1500
Reputation: 4663
I assume you are using a TCP-based check? If so, make the load balancer check/monitor more intelligent, i.e. use a HTTP-based monitor that actually checks that HTTP responses are valid.
Upvotes: 1