r/linuxadmin • u/pur3s0u1 • Mar 05 '26
Multi primary VRRP/CARP net loadbalance setup
Is someone using that setup, it's gose like this:
Balance on vip, so the traffic is split over all hosts and then redirected to pool of backend hosts? Not just Master/Standby mode with redirect...
5
Upvotes
2
u/lottspot Mar 05 '26
VRRP and CARP are, by their very nature, active/passive protocols. It is not possible to run an active/active pair. Distributing traffic to an active/active pair requires the use of specialized routing techniques (e.g., multipathing or anycast) and solving some sticky problems (like packet hashing on the router side or state replication between the firewall pair). I am no expert in these complex approaches; you would have to read up on them to get an idea of how to apply them.
1
u/lebean Mar 05 '26
You're hoping to have the same VIP active on two hosts at the same time? Yikes.
If you really need active/active (highly doubt you're exhausting any modern CPU or NIC in an active/standby setup), run two VIPs where each prefers to run on opposite hosts and do round-robin DNS. That way if both hosts are up you get roughly distributed traffic across them and if either host goes down, its VIP goes live on the survivor and that host carries the whole load.
In the end, no way you need this since a single host (a quality server, not a desktop PC) can easily load balance hundreds of thousands of connections per second. Just have another in standby and you're good to go.
1
u/johnny_snq Mar 06 '26
In my experience and that of ll the major cloud providers load balancing is better achieved via dns. As others have mentioned vrrp and carp are suitable for failover more than for balancing. You could look at ipvs admin to balance the vip to a series of backends running the application
1
u/nof Mar 08 '26
Use ha proxy.
1
u/symcbean Mar 05 '26
As u/lottspot says, VRRP, CARP and VIPs are failover tools (although VIPs can be used for in load balancer setups). Load balancing is something completely different. Failover should be your last resort for providing high availability - but there are niche cases where it is necessary (such as for routers - the use-case VRRP and CARP were designed for).
Perhaps if you explained what the service is that you wish to make highly available you might get more useful suggestions.