Balancing two Front End to two Back End servers
I have a configuration with two front end servers(Front1 & Front2) that communicate to virtual servers that load balances across two backend servers(Back1 & Back2) for a non-stand TCP ports, SQL, and 443. I have source address affinity configured with 900 seconds which is required by my vendor. The connections between frontend and backend servers are long lived.
Here’s my issue: When we bring down one backend(Back1) server for maintenance, all connections & persistence sourced from Front1 & Front2 move to the active backend server(Back2) as expected. When the backend server(Back1) comes out of maintenance, new connections will always go to the server that remained active(Back2). In this scenario, Front1 & Front2 will never connect to the server that went in/out of maintenance(Back1).
I’m trying to find a solution for this. I have the following options which I think will work, but I could use some help creating the irule for each option. If someone has any better ideas, I’d like to hear them. I would appreciate any help with this.
Option 1 – iRule - Mapping One-to-One If Destination Back1 IP/Port is up and destination Back2 IP/Port is up, Then send Front1 to Back1 and Front2 to Back2 If Back1 IP/Port is down, send all to Back2 IP/Port If Back2 IP/Port is down, send all to Back1 IP/Port
Option 2 – iRule – Clear Persistence when server goes down/up Monitor both pool members. If one member goes down and up, clear persistence.
Thanks,