I have a scenario where i have two tomcat servers A and B behind the haproxy, now one of the app servers have a new version of the war and the other tomcat has a old version of the war file.So at a point of time we will have only the server A active which has a set of users inside it , after a while we enable the server B now any new request that comes should go only to app server B and the old users should still be at app server B. How should this be done in haproxy , i have enabled session persistence using appsession . Is there a way that this could be achieved?
I believe you could accomplish this by adjusting the server weight within an haproxy backend. You can use the socket cli to set weight at run time. See the documentation for set weight. The documentation for weight states:
I've never tried this before, so you will want to experiment to make sure it has the desired result. Also I believe any weight set via the socket cli is going to reset if you restart haproxy.