Load Balancing Active Active
-
Hi,
i have set up two load balancers with pf sense and two real servers with power dns behind it. Which works fine, but one of the load balancers is always passive (active passive scenario). Is it possible to set up an active active setup with pf sense. Where the master load balancer would control a pool of two real servers and the slave would control a pool of two real servers. When one of the load balancers is down the other one takes over the pool and controls 4 real servers during the down time.
-
If I get you right this should be possible. You can't sync CARP/VIP settings but have to enter them manually for this to work as syncing VIPs will make one node Master for all IPs and the other Backup for all IPs:
Loadbalancer1
CARP-IP1 Advertisingfrequency 0 (this means highest Priority and Master if up)
CARP-IP2 Advertisingfrequency 0
CARP-IP3 Advertisingfrequency 100 (this means lower priority than 0 and if there is someone with 0 up this node will be Backup)
CARP-IP4 Advertisingfrequency 100These settings should be reversed at the other machine:
Loadbalancer2
CARP-IP1 Advertisingfrequency 100
CARP-IP2 Advertisingfrequency 100
CARP-IP3 Advertisingfrequency 0
CARP-IP4 Advertisingfrequency 0Now add your Loadbalancing pools just the way you did for the single setup but use the CARP IPs. This should do what you want. Each machine will have their main 2 IPs as Master and will deal with the other 2 IPs if the other node is down.
-
That could be the answer to my problem i will give it a try soon. Thanks a lot for your help.
-
That could be the answer to my problem i will give it a try soon. Thanks a lot for your help.
Make sure you don't have asymmetric routing. You'll need two carp addresses on the INSIDE also with each group of servers using it's respective carp IP as it's return gateway. While pfSense will sync it's state table, it's not instantaneous and I can guarantee issues with out of state packets.
–Bill