regarding carp and nginx

看板FB_questions作者時間12年前 (2013/04/27 13:02), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/3 (看更多)
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"
文章代碼(AID): #1HUrldBi (FB_questions)
文章代碼(AID): #1HUrldBi (FB_questions)