I have two Servers, Server A,ServerB. running as TCP socket server.
I want to a active/standby or /active/passive failover.
that means:
1:Server A and Server B Running, route ALL connection to Server A.
2:Server A down, route ALL connection to Server B.
3:Server A back, still route ALL connection to Server B.
4:Server B down, then route ALL connection to Server A.
ONLY will be one server handle all the connections at a time.
I have search a lot.
it seems that HAProxy have a trick to do like this. Prevent HAProxy from toggling back from fallback to master
but it have a problem, in the case 4, when Server B down, Server A is running, the HAPRoxy still do not route connection to Server A.
is there a way to reolve it?
I also have try Nginx, did not work at all.
listen sql-cluster 0.0.0.0:1433 balance roundrobin server sql01 192.168.100.109:1433 check backup server sql02 192.168.100.180:1433 check inter 5s fall 3 rise 99999999