[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: CARP load balancing
- To: misc_(_at_)_openbsd_(_dot_)_org
- Subject: Re: CARP load balancing
- From: Jason Opperisano <opie_(_at_)_817west_(_dot_)_com>
- Date: Mon, 25 Apr 2005 10:53:06 -0400
- Mail-followup-to: Jason Opperisano <opie_(_at_)_817west_(_dot_)_com>, misc_(_at_)_openbsd_(_dot_)_org
On Sat, Apr 23, 2005 at 09:29:01PM +0300, nikns wrote:
> Hello,
> I am mucking with CARP.
> I have 2 web servers. Instead of dns round robin i wan't to use carp.
> I have read [http://openbsd.bug.lv/faq/faq6.html#CARP] but it doesnt work.
> I guess i don't know something.
> Maybe you can point to me please what i have wrong?
>
> domain.com [xxx.xxx.xxx.226] <-- free ip
> web.domain.com [xxx.xxx.xxx.227] <-- first web server
> web2.domain.com [xxx.xxx.xxx.230] <-- second web server
>
> my configuration:
> first web server:
> # cat /etc/hostname.xl0
> inet xxx.xxx.xxx.227 255.255.255.240 NONE
> # cat /etc/hostname.carp0
> inet xxx.xxx.xxx.226 255.255.255.0 xxx.xxx.xxx.225 vhid 1 pass mirsti advskew
> 100
> # cat /etc/hostname.carp1
> inet xxx.xxx.xxx.226 255.255.255.0 xxx.xxx.xxx.225 vhid 2 pass dirsti advskew
> 0
coupla things:
the broadcast on your carp interfaces is wrong--225 is netid, the
broadcast would be 239.
you've configured two carp interfaces with the same carp IP with
different vhid's on the same host. i cannot fathom why you've done
this.
i'm no carp guru, but i'm pretty sure you don't want advskew 0...
> # sysctl -a | grep carp
> net.inet.carp.allow=1
> net.inet.carp.preempt=1
> net.inet.carp.log=1
> net.inet.carp.arpbalance=1
> # ifconfig -a
> lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33192
> inet 127.0.0.1 netmask 0xff000000
> inet6 ::1 prefixlen 128
> inet6 fe80::1%lo0 prefixlen 64 scopeid 0x6
> sk0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
> address: 00:0c:41:1a:34:89
> media: Ethernet autoselect (1000baseT full-duplex,flag0,flag1)
> status: active
> inet 10.195.0.1 netmask 0xffffff00 broadcast 10.195.0.255
> inet6 fe80::20c:41ff:fe1a:3489%sk0 prefixlen 64 scopeid 0x1
> xl0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
> address: 00:0a:48:12:a7:81
> media: Ethernet none (none)
> inet xxx.xxx.xxx.227 netmask 0xfffffff0 broadcast xxx.xxx.xxx.239
> inet6 fe80::20a:48ff:fe12:a781%xl0 prefixlen 64 scopeid 0x2
> pflog0: flags=141<UP,RUNNING,PROMISC> mtu 33192
> pfsync0: flags=0<> mtu 2020
> enc0: flags=0<> mtu 1536
> carp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
> carp: BACKUP carpdev xl0 vhid 1 advbase 1 advskew 100
> inet xxx.xxx.xxx.226 netmask 0xffffff00 broadcast xxx.xxx.xxx.225
> carp1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
> carp: MASTER carpdev xl0 vhid 2 advbase 1 advskew 0
> inet xxx.xxx.xxx.226 netmask 0xffffff00 broadcast xxx.xxx.xxx.225
<--snip second carp config-->
> After i `sh /etc/netstart carp1` i get:
> Apr 22 11:05:02 web2 /bsd: duplicate IP address xxx.xxx.xxx.226 sent from
> ethernet address 00:00:5e:00:01:02
> Apr 22 11:05:02 web2 /bsd: duplicate IP address xxx.xxx.xxx.226 sent from
> ethernet address 00:00:5e:00:01:01
> Apr 22 11:05:02 web2 /bsd: duplicate IP address xxx.xxx.xxx.226 sent from
> ethernet address 00:00:5e:00:01:02
precisely.
-j
--
"Brian: Whose leg do I have to hump to get a dry martini around here?"
--Family Guy
Visit your host, monkey.org