Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Dec 2012 15:16:14 +0100
From:      Ruben de Groot <mail25@bzerk.org>
To:        Joar Jegleim <joar.jegleim@gmail.com>
Cc:        questions@freebsd.org
Subject:   Re: regarding carp and nginx
Message-ID:  <20121214141614.GA96145@ei.bzerk.org>
In-Reply-To: <CAFfb-hoHHdbKM1rpxTDMM69d5yBDKyB7eyY-aooTJr7-GXx6wA@mail.gmail.com>
References:  <CAFfb-hoHHdbKM1rpxTDMM69d5yBDKyB7eyY-aooTJr7-GXx6wA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

I suspect (but just guessing), that the "ifconfig carp0 down"
sends out some CARP packet that notifies the passive node to take
over.
Rebooting or powering down the active node probably doesn't 
send this packet, so the passive node will wait until some timeout
before taking over.

Ruben

On Thu, Dec 13, 2012 at 01:19:59PM +0100, Joar Jegleim typed:
> Hi !
> 
> I'm in the process of setting up a HA nginx proxy using carp in
> FreeBSD 9.0-RELEASE .
> I've got a active/passive setup where both nodes are running an nginx
> server listening to carp0 .
> 
> If I issue: ifconfig carp0 down on the active node, the passive node
> takes over immediately .
> But when I for instance issue a simple reboot from the master node,
> then try accessing any web page through the proxy I'm getting a
> connection error for 3-5 seconds .
> It's kinda strange because if I ping the carp0 ip from my workstation
> when reboot'ing the master I don't see this kind of drop in connection
> (that is the passive node immediatly becomes master and reply my ping)
> 
> I've tried having nginx listen to all available interfaces, same result.
> I've tried writing a simple devd.conf rule such as:
> notify 0 {
>    match "system"      "IFNET";
>    match "type"        "LINK_UP";
>    match "subsystem"       "carp*";
>    action "/root/bin/carpcontrol.sh $type $subsystem";
> };
> 
> notify 0 {
>    match "system"      "IFNET";
>    match "type"        "LINK_DOWN";
>    match "subsystem"       "carp*";
>    action "/root/bin/carpcontrol.sh $type $subsystem";
> };
> 
> where carpcontrol.sh got:
> #!/bin/sh
> 
> type=$1
> subsystem=$2
> 
> echo "$(date) called with type=$type and subsystem=$subsystem" >>
> /var/log/carp/carp.log
> /usr/local/etc/rc.d/nginx restart >> /var/log/kit/carp.log
> 2>>/var/log/carp/carp.log
> 
> 
> which doesn't help, I still get 3-5 seconds drop in connection if I
> reboot the master node .
> I've also tried to just cut the power for the master node, still
> getting those 3-5 seconds drop .
> 
> I've set the following in sysctl.conf
> #Accept incoming CARP packets. Enabled by default.
> net.inet.carp.allow=1
> #This option downs all of the CARP interfaces on the host when one of
> them goes down. Disabled by default
> net.inet.carp.preempt=1
> #A value of 0 disables any logging. A Value of 1 enables logging of
> bad CARP packets. Values greater than 1 enables logging of state
> changes for the CARP interfaces. The default value is 1.
> net.inet.carp.log=2
> 
> 
> 
> -- 
> ----------------------
> Joar Jegleim
> Homepage: http://cosmicb.no
> Linkedin: http://no.linkedin.com/in/joarjegleim
> fb: http://www.facebook.com/joar.jegleim
> AKA: CosmicB @Freenode
> 
> ----------------------
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20121214141614.GA96145>