I have created a load balancing scenario in my machine and the same works fine. However, I am stuck at one simple issue and request help on the same.
I have two tomcat workers - worker1 and worker2. I also have a loadbalancer called balancer. workers.properties file has been created as follows -
Now, I have a webapp say webapp1 which is used by endusers extensively. I hence want that all the user requests for webapp1 should be handled by worker1. For this I have added the below lines in httpd.conf file in my apache's conf dir -
This works fine as well. The only problem here is that if tomcat1 (worker1) is down, the balancer doesn't direct the request for webapp1 to tomcat2 (worker2). How do I resolve this issue?
If you want requests to go to worker 1 by default and then to worker 2 if and only if worker 1 fails you'll need to set up a second lb worker (call it lb2) with two workers (tomcat1b and tomcat2b) and use the distance parameter to give tomcat2b a larger distance than tomact1b. That will cause tomcat1b to be used in preference to tomcat2b unless tomcat1b fails.
See the workers.properties docs for more info: http://tomcat.apache.org/connectors-doc/reference/workers.html
BTW you have tomcat1 in your workers.properties but worker1 in your JKMount. That won't work.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.