Graceful restart for load-balancing multiple Apache Tomcat servers


I have successfully set up the load-balancing multiple Apache Tomcat servers using Apache web server. I am using mod_jk and the weight for each Tomcat is controlled via "lbfactor".

Now, every time I need to deploy a newer version of my application to Tomcat, I do NOT want my users to be affected (transparently). Hence, I am thinking below.

1. Change 1 (one) Tomcat server's lbfactor to all the existing connection from this server will be gone.
2. Shutdown this Tomcat server, deploy the new application and restart it.
3. Change the lbfactor back to 1.
4. Change the rest of Tomcat's lbfactor to 0 and repeat steps 1-3 for them.

Now, questions.
1. When I changed the lbfactor (in the, can I use graceful restart so that the apache is still receiving the connection and users are not affected?
2. When I change the lbfactor to 0, how do I check (in Apache) is there still any active connection to my Tomcat server whose lbfactor have been set to 0? Or will all the existing sessions be immediately transferred to other servers by Apache?


LVL 16
Who is Participating?
suprapto45Author Commented:

Sorry for the delay. I was very busy today. Let me hv a look at them tomorrow morning and i will let you know.

Thanks again
suprapto45Author Commented:
Hi arober11,

Perfect solution. Thanks again.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.