We do have a Apache-Tomcat load balancer with 1 Apache load balancer and 3 Tomcat workers. The issue which we feel is there is something wrong with our configuration due to which the load balancer detects workers in error state and then stops all sessions on that worker.
Due to which many of our users faces session time out message and they have to re-login to the application.
Note : The application is kind of Approval Management Application on which the users are required to upload/download pdf, excel, word etc. files.
We feel that there is something which we are missing with our configuration and afte searching many blogs still we are not able to resolve it.
Here are my some of the configuration file details which you may refer to help us out.
workers.properties
worker.list=loadbalancer,status
#setup node1
worker.node1.port=8109
worker.node1.host=<ip of worker1>
worker.node1.type=ajp13
worker.node1.lbfactor=1
#setup node2
worker.node2.port=8209
worker.node2.host=<ip of worker2>
worker.node2.type=ajp13
worker.node2.lbfactor=1
#setup node3
worker.node3.port=8309
worker.node3.host=<ip of worker3>
worker.node3.type=ajp13
worker.node3.lbfactor=1
#setup the load-balancer
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=node1,node2,node3
worker.loadbalancer.sticky_session=True
# Status worker for managing load balancer
worker.status.type=status
mod_jk log
[Wed May 17 16:16:24 2023] [30113:139835845805824] [error] ajp_get_reply::jk_ajp_common.c (2326): (node2) Tomcat already send headers
[Wed May 17 16:16:24 2023] [30113:139835845805824] [error] ajp_service::jk_ajp_common.c (2767): (node2) sending request to tomcat failed (unrecoverable), (attempt=1)
[Wed May 17 16:16:24 2023] [30113:139835845805824] [info] service::jk_lb_worker.c (1600): service failed, worker node2 is in error state
[Wed May 17 16:16:24 2023] [30113:139835845805824] [error] service::jk_lb_worker.c (1625): unrecoverable error 502, request failed. Tomcat failed in the middle of request, we can't recover to another instance.
[Wed May 17 16:16:24 2023] [30113:139835845805824] [error] service::jk_lb_worker.c (1685): All tomcat instances failed, no more workers left
[Wed May 17 16:16:24 2023] [30113:139835845805824] [info] jk_handler::mod_jk.c (2991): Service error=0 for worker=loadbalancer
Anyone who do have any idea and can provide us a solution would be a greate help to us.
Please let us know if any further details are required...
we need to see conf/server.xml files to solve this issue. but you can check ajp connector section of your 3 tomcat server.xml's. "Port" and "Redirectport" values need to be different for every Tomcat server.
For Example: