<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>16hot 的博客 &#187; carp</title>
	<atom:link href="http://www.16hot.com/tag/carp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.16hot.com</link>
	<description>技术、工作、生活，坚持一种信念，一切皆有可能……</description>
	<lastBuildDate>Sat, 07 Jan 2012 11:09:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>关注FreeBSD下的新版CARP</title>
		<link>http://www.16hot.com/2011/08/1241/</link>
		<comments>http://www.16hot.com/2011/08/1241/#comments</comments>
		<pubDate>Thu, 18 Aug 2011 01:13:59 +0000</pubDate>
		<dc:creator>16hot</dc:creator>
				<category><![CDATA[BSD/linux]]></category>
		<category><![CDATA[carp]]></category>
		<category><![CDATA[freebsd]]></category>

		<guid isPermaLink="false">http://www.16hot.com/?p=1241</guid>
		<description><![CDATA[http://lists.freebsd.org/pipermail/freebsd-net/2011-August/029539.html http://people.freebsd.org/~glebius/newcarp/README Hello networkers, I'd like to present for review and early testing (for brave ones) a new CARP implementation. The reason for this rewrite was that CARP protocol actually doesn't bring a new interface, but is a property of interface address. Rewriting it in this way helps to remove several hacks from incoming packet [...]]]></description>
			<content:encoded><![CDATA[<p>http://lists.freebsd.org/pipermail/freebsd-net/2011-August/029539.html</p>
<p>http://people.freebsd.org/~glebius/newcarp/README</p>
<blockquote>
<pre>  Hello networkers,

  I'd like to present for review and early testing (for brave ones)
a new CARP implementation. The reason for this rewrite was that CARP
protocol actually doesn't bring a new interface, but is a property of
interface address. Rewriting it in this way helps to remove several
hacks from incoming packet processing[1], simplifies some code, makes
CARP addresses more sane from viewpoint of routing daemons such as
quagga/zebra. It also brings support for a single redundant address
on the subnet, the thing that is called "carpdev feature" in OpenBSD,
long awaited in FreeBSD.

More info and the patch itself is available here:

<a href="http://people.freebsd.org/%7Eglebius/newcarp/README">http://people.freebsd.org/~glebius/newcarp/README</a>

I'm glad to here comments.</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.16hot.com/2011/08/1241/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FreeBSD: Redundant DNS with CARP</title>
		<link>http://www.16hot.com/2010/12/1177/</link>
		<comments>http://www.16hot.com/2010/12/1177/#comments</comments>
		<pubDate>Sat, 11 Dec 2010 03:41:00 +0000</pubDate>
		<dc:creator>16hot</dc:creator>
				<category><![CDATA[BSD/linux]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[转载]]></category>
		<category><![CDATA[carp]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[freebsd]]></category>

		<guid isPermaLink="false">http://www.16hot.com/?p=1177</guid>
		<description><![CDATA[http://zi0r.com/2010/02/28/freebsd-redundant-dns-with-carp.html Improve reliability with CARP and redundant DNS on two boxes. Almost everyone already has (at least) two nameservers, so why not add CARP into the mix to make it appear as if they’re always available? This setup assumes two nameservers. Both nameservers will have a total of 3 IPs assigned to them, two of [...]]]></description>
			<content:encoded><![CDATA[<p>http://zi0r.com/2010/02/28/freebsd-redundant-dns-with-carp.html</p>
<p>Improve reliability with CARP and redundant DNS on two boxes.  Almost  everyone already has (at least) two nameservers, so why not add CARP  into the mix to make it appear as if they’re always available?</p>
<p>This setup assumes two nameservers.  Both nameservers will have a  total of 3 IPs assigned to them, two of which are the floating CARP IPs  and one of which is a unique management IP for each box.  Each  nameserver will be the CARP backup for the other nameservers primary  nameserver IP.  If one goes down, the other will assume responsibility  for the IP.</p>
<p>You’ll need to assign your nameservers two new IPs (to be used for  management) and take the original pair of IPs and we’ll use those for  the carp interfaces.</p>
<p>1.  Rebuild/install your kernel with:<br />
device		carp</p>
<p>2.  Edit /etc/rc.conf to add:<br />
cloned_interfaces=“carp0 carp1”<br />
ifconfig_carp0=“create”<br />
ifconfig_carp1=“create”</p>
<p>3.  Setup the CARP interfaces:</p>
<p>I set the vhid’s to be the last octet of the floaty IP, however, you  can set them to be whatever you want as long as they match on both  boxes.</p>
<p>On ns1:<br />
Create /etc/start_if.carp0 with the following:<br />
#!/bin/sh<br />
ifconfig carp0 vhid XX advbase 1 advskew 10 pass supersecretpasswordhere  netmask</p>
<p>Create /etc/start_if.carp1 with the following:<br />
#!/bin/sh<br />
ifconfig carp1 vhid YY advbase 2 advskew 10 pass othersupersecretpasswordhere  netmask</p>
<p>Then run:<br />
chmod go-rwx /etc/start_if.carp*;chmod +x /etc/start_if.carp*</p>
<p>On ns2:<br />
Create /etc/start_if.carp0 with the following:<br />
#!/bin/sh<br />
ifconfig carp0 vhid YY advbase 1 advskew 10 pass supersecretpasswordhere  netmask</p>
<p>Create /etc/start_if.carp1 with the following:<br />
#!/bin/sh<br />
ifconfig carp1 vhid XX advbase 2 advskew 10 pass othersupersecretpasswordhere  netmask</p>
<p>Then run:<br />
chmod go-rwx /etc/start_if.carp*;chmod +x /etc/start_if.carp*</p>
<ul>
<li>carp0 on both boxes will be its PRIMARY IP whereas carp1 will be  the SECONDARY IP on both.  In a non-failover scenario, this means that  carp0 on both boxes should show up as MASTER and carp1 should show up as  BACKUP.</li>
</ul>
<p>4.  Ensure named is configured to bind to the management IP (for zone  transfers, etc.), ns1.ip and ns2.ip (on both boxes!) or ensure that it  listens on *.</p>
<p>5.  Add net.inet.carp.log=2 to /etc/sysctl.conf for some extra logging info.</p>
<p>6.  Reboot.  Your primary box should come up with ns1.ip as MASTER  and ns2.ip as BACKUP.  Your secondary box should come up with ns2.ip as  MASTER and ns1.ip as BACKUP.  Check ifconfig and dmesg to confirm.</p>
<ul>
<li>Note: CARP traffic is multicast and you may need to alter firewalls  as appropriate to allow it.  The destination is  VRRP.MCAST.NET/224.0.0.18.<br />
For defining masters/slaves, etc. in bind you will want to  reference the management IPs of the boxes, not the floating CARP  addresses.</li>
</ul>
<ul>
<li>Note: You can actually skip using the start_if.* files if you elect  to put the ifconfig statements into rc.conf.  In order to limit access  to your CARP authentication key, you would need to change the  permissions on rc.conf which could be bad in certain situations.</li>
</ul>
<ul>
<li>ESX Note: If you’re trying to do this with a box in VMware, you’ll  need to disable the vSwitch security features (accept: promisc, forged  transmits, mac changes).  This is not advisable in production as any VM  on that switch can sniff traffic from any other VM.  For my setup at  home, I simply allocated a second NIC and a second vSwitch and made the  security changes on the dedicated vSwitch.  No other VMs should share  this other vSwitch where the security features have been disabled.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.16hot.com/2010/12/1177/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>实战：用Carp实现故障转移和负载均衡集群(转)</title>
		<link>http://www.16hot.com/2010/07/1020/</link>
		<comments>http://www.16hot.com/2010/07/1020/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 03:14:48 +0000</pubDate>
		<dc:creator>16hot</dc:creator>
				<category><![CDATA[BSD/linux]]></category>
		<category><![CDATA[carp]]></category>
		<category><![CDATA[freebsd]]></category>

		<guid isPermaLink="false">http://blog.isyi.com/?p=1020</guid>
		<description><![CDATA[在服务器b上修改大致相同，只是carp网卡的有一点变动 ee /etc/rc.conf       #配置rc.conf文件，分别建立carp虚拟网卡。增加如下内容 cloned_interfaces=&#8221;carp0 carp1&#8243; ifconfig_carp0=&#8221;vhid 1 advbase 5 advskew 100 pass passwd 192.168.1.100/24&#8243; ifconfig_carp1=&#8221;vhid 2 advbase 5 pass passwd 192.168.1.100/24&#8243; ee /etc/sysctl.conf     #修改sysctl文件启用carp的arpbalance和carp抢占功能。增加如下内容 net.inet.carp.preempt=1 net.inet.carp.arpbalance=1 重启两台服务器即 可生效。 如果不想重启服务器，立即生效则进行下列命令 服务器a ifconfig carp0 create ifconfig carp0 vhid 1 advbase 5 pass passwd 192.168.0.100/24 ifconfig carp1 create ifconfig carp1 vhid 2 advbase 5 advskew 100 passwd [...]]]></description>
			<content:encoded><![CDATA[<p>在服务器b上修改大致相同，只是carp网卡的有一点变动<br />
ee /etc/rc.conf        #配置rc.conf文件，分别建立carp虚拟网卡。增加如下内容<br />
cloned_interfaces=&#8221;carp0 carp1&#8243;<br />
ifconfig_carp0=&#8221;vhid 1 advbase 5 advskew 100 pass passwd  192.168.1.100/24&#8243;<br />
ifconfig_carp1=&#8221;vhid 2 advbase 5 pass passwd  192.168.1.100/24&#8243;</p>
<p>ee /etc/sysctl.conf      #修改sysctl文件启用carp的arpbalance和carp抢占功能。增加如下内容<br />
net.inet.carp.preempt=1<br />
net.inet.carp.arpbalance=1</p>
<p>重启两台服务器即 可生效。<br />
如果不想重启服务器，立即生效则进行下列命令<br />
服务器a<br />
ifconfig carp0  create<br />
ifconfig carp0 vhid 1 advbase 5 pass passwd 192.168.0.100/24<br />
ifconfig carp1 create<br />
ifconfig carp1 vhid 2 advbase 5 advskew 100  passwd 192.168.0.100/24<br />
sysctl net.inet.carp.preempt=1<br />
sysctl  net.inet.carp.arpbalance=1</p>
<p>服务器b</p>
<p>ifconfig carp0  create<br />
ifconfig carp0 vhid 1 advbase 5 advskew 100 pass passwd  192.168.0.100/24<br />
ifconfig carp1 create<br />
ifconfig carp1 vhid 2  advbase 5 passwd 192.168.0.100/24<br />
sysctl net.inet.carp.preempt=1<br />
sysctl net.inet.carp.arpbalance=1</p>
<p>ok,现在可以看到效果了。如果两台服务器正常，则客户请求分 别由两台服务器均衡的提供服务。当断掉其中一台服务器，则另一台服务器，可立即接管所有服务。当这台服务器恢复服务，则又会自动启用负载均衡。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.16hot.com/2010/07/1020/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

