How to make a grandiose hot deployment on Tomcat (non-stop)

Our products are powered by LB + TOMCAT. We use our own custom-made SAFE-DEPLOY tool to deploy changes in the production process. Since our system is designed to provide 24/7 availability, the tool deploys the changes as follows

Total servers used for a particular service are divided into groups. Suppose it is divided into 2 groups and stops one group, deploys the changes, and starts the group. After the completion of the first group, they unfold the changes in another group. In most cases, it works fine without any problems.

The problem is caused by a special case. One service generates a token that the client accepts as credentials, now we changed the format of the token, if we use the same deployment approach, there should be some potential problems .ie.group1 stops and deploys the new code, and then reboots (this is normal), stop group2 (prepare to deploy new code), now an error may occur when deploying group2, because during this time group1 can receive the old-format token generated by group2 (1. When group1 is deployed aetsya, group2 starts the old code, 2.group2 stops can not process your request), the client receives an error that indicates the token correctly, but it's not really an incorrect token.

I have a solution so that our code can process a new format token and an old format token, but only generates a new format token, after 1 day we can do a deployment that processes only a new format token. I think it works great, but it's not grace.

My question is: is there any competent deployment approach that forces the server to process both the old formatted token that was generated and the new formatted token without changing the code.

By the way: I find the link, the best practice of hot deployment on tomcat , it only works for tomcat 7, our working tomcat is 6.0.26.

+4
source share
1 answer

Yes, there may be a second way. First, you activate sticky sessions on loadbalancern (apache + mod_jk). This means that the client always connects to the same server. Secondly, you disable (do not stop) the worker (server). Only existing sessions will be served, not new ones. If the worker no longer has open sessions, you stop working, update the worker, and include the worker in LB. It is, but I propose my own way.

0
source

All Articles