Hi,
I am trying to setup a Blue/Green zero downtime architecture.
I am using HAProxy and 2 Tomcats and a separate Redis server for a central storage of the session
(I introduced Redis to test, I was using initially just Tomcat to storage and replicate the sessions and I was getting the same behavior described below anyway).
This is my HAProxy config:
global
ssl-default-bind-options ssl-min-ver TLSv1.2
maxconn 20000
log 127.0.0.1 local0
user haproxy
chroot /usr/share/haproxy
pidfile /run/haproxy.pid
daemon
# turn on stats unix socket
stats socket /var/lib/haproxy/stats level admin
frontend stats
bind *:80
mode http
stats enable
stats uri /stats
stats refresh 10s
stats admin if TRUE
frontend main
bind :443 ssl crt /etc/ssl/certs/tomcat/cert.pem
maxconn 8000
timeout client 30s
default_backend app
backend app
mode http
cookie JSESSIONID prefix nocache
option httpchk
option redispatch
option http-keep-alive
timeout connect 1s
timeout server 30s
balance roundrobin
server app1 172.31.1.41:443 cookie app1 check ssl verify none
server app2 172.31.1.42:443 cookie app2 check ssl verify none
What I would like is this:
1.- User initiates Connection to app1 backend
2.- I disable app1 or app1 server goes down
3.- User gets moved to app2 without loosing his session
4 .- I enable or bring up app1 server
5.- User gets moved to app1 server without loosing his session (I dont mind disabling/stoping app2 temporarly to force the migration if neccesary)
What is happening currently:
1.- User initiates Connection to app1 backend
2.- I disable app1 or app1 server goes down
3.- User gets moved to app2 without loosing his session
4 .- I enable or bring up app1 server
5.- User is brought back to login screen
Just for additional info on my current setup
I am not using AJP (mod_jk workers configuration) for the tomcats because I want to avoid using AJP if possible.
At this point I am a bit lost on what is causing this and how to troubleshoot, if there is anyone that can give any advice or have any ideas they will be greatly appreciated and more than welcome.
Thanks for reading.