From owner-freebsd-questions@FreeBSD.ORG Thu Dec 13 12:20:01 2012 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 882FEC00 for ; Thu, 13 Dec 2012 12:20:01 +0000 (UTC) (envelope-from joar.jegleim@gmail.com) Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by mx1.freebsd.org (Postfix) with ESMTP id 16E448FC0A for ; Thu, 13 Dec 2012 12:20:00 +0000 (UTC) Received: by mail-wi0-f174.google.com with SMTP id hm9so3975904wib.13 for ; Thu, 13 Dec 2012 04:19:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=BjaWkPvvjuYb91rAeKTB+jfDJaqn9+wYB1kJKtCjjdI=; b=QtQCkjyqxzLpnF477cjfexDOAUiGCgkTFux31o68EuBNLvkQBrT6Luj/BQC8vrpdzs EFQRO0nzeNWK+jvIUrA9VfKegjLRsDLzi2Oy6SmiAE2MQK2JGuQU261LP4FWtBn32O5V vqPXlHGhUwgTeU1JDEeQ7jJVBz7mXYUORyUucBMzU0jusPtmeaKs1JzB13a6o6NUkvv1 PQyDfZA4KgNRa8sqql7+1ZRPxiKlDcX8vpma0ifgxk8xp/cjUm2KcETywQbFB3B9VZ79 +6SXWh6F1fhI7fHL4eBGF0Ljz2rFs7Y1x2GjCtPyf2aTKHrhjA1Agh4R/avpROZpxpk6 UqlA== MIME-Version: 1.0 Received: by 10.180.101.104 with SMTP id ff8mr2005541wib.11.1355401199765; Thu, 13 Dec 2012 04:19:59 -0800 (PST) Received: by 10.227.2.133 with HTTP; Thu, 13 Dec 2012 04:19:59 -0800 (PST) Date: Thu, 13 Dec 2012 13:19:59 +0100 Message-ID: Subject: regarding carp and nginx From: Joar Jegleim To: questions@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2012 12:20:01 -0000 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 ----------------------