CARP not balancing automatically

Max Laier max at love2party.net
Mon Oct 23 17:51:10 UTC 2006


On Monday 23 October 2006 17:34, Vivek Khera wrote:
> I'm attempting to use CARP with arpbalance to load balance some
> services.  My only problem is that the balancing doesn't happen
> automatically.
>
> The configuration is just from the carp man page:
>
> ifconfig_em0="inet XXX.XXX.XXX.55 netmask 255.255.255.192 "
> ifconfig_em1="inet 192.168.100.55 netmask 255.255.255.0 "
> ifconfig_carp0="inet 192.168.100.100 netmask 255.255.255.0 vhid 5
> pass dns-prv"
> ifconfig_carp1="inet 192.168.100.100 netmask 255.255.255.0 vhid 6
> advskew 100 pass dns-prv"
> cloned_interfaces="carp0 carp1"
>
> and on the other box:
>
> ifconfig_em0="inet XXX.XXX.XXX.56 netmask 255.255.255.192 "
> ifconfig_em1="inet 192.168.100.56 netmask 255.255.255.0 "
> ifconfig_carp0="inet 192.168.100.100 netmask 255.255.255.0 vhid 5
> advskew 100 pass dns-prv"
> ifconfig_carp1="inet 192.168.100.100 netmask 255.255.255.0 vhid 6
> pass dns-prv"
> cloned_interfaces="carp0 carp1"
>
>
> and of course net.inet.carp.arpbalance=1 in /etc/sysctl.conf.
>
>
> When I reboot the systems, the first one to boot up becomes the
> MASTER for both carp0 and carp1 interfaces and remains so even after
> the other machine comes up.  The second machine to boot comes up in
> BACKUP mode for both interfaces.
>
> The only way to make the balance change is to bring down carp0 on the
> box not designated as the master for it momentarily until such time
> that the first one (the designated master for carp0) takes over, then
> bring up carp0 again.
>
> Until I perform this manual step, all traffic goes to the single box.
> After I perform this step, the traffic is balanced nicely as expected
> amongst the local network hosts.  Each box then has one MASTER and
> one BACKUP carp interface for this IP.

Sounds like you forgot the net.inet.carp.preempt sysctl.  See the begining 
of the EXAMPLES section of carp(4).

> What can I do to make the balance automatic as the docs imply?  This
> also happens on another pair of machines I have which are CARP +
> arpbalance for another IP.
>
> The NICs in question are hooked up to a gigabit switch.

-- 
/"\  Best regards,                      | mlaier at freebsd.org
\ /  Max Laier                          | ICQ #67774661
 X   http://pf4freebsd.love2party.net/  | mlaier at EFnet
/ \  ASCII Ribbon Campaign              | Against HTML Mail and News
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20061023/38a4c60f/attachment.pgp


More information about the freebsd-stable mailing list