<?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>IPCPU——网络之路 &#187; Heartbeat</title>
	<atom:link href="http://www.ipcpu.com/tag/heartbeat/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ipcpu.com</link>
	<description></description>
	<lastBuildDate>Mon, 06 Sep 2010 07:46:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Heartbeat双机热备体验</title>
		<link>http://www.ipcpu.com/2009/11/heartbeat-dual-machine-hotbackup/</link>
		<comments>http://www.ipcpu.com/2009/11/heartbeat-dual-machine-hotbackup/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 08:34:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[网络技术]]></category>
		<category><![CDATA[Heartbeat]]></category>
		<category><![CDATA[双机热备]]></category>

		<guid isPermaLink="false">http://www.ipcpu.com/?p=228</guid>
		<description><![CDATA[先按照老师的来吧，先用下Heartbeat，LVS和keepalived到实验室再做吧。 实验拓扑图如下： 1.安装heartbeat，我这里用的yum，装了2遍，不知怎回事。 [root@s1 ~]# yum install nginx 2.把配置文件复制到/etc/ha.d [root@s1 ~]# cd /usr/share/doc/heartbeat-2.1.3/ [root@s1 heartbeat-2.1.3]# cp ha.cf /etc/ha.d/ [root@s1 heartbeat-2.1.3]# cp authkeys /etc/ha.d/ [root@s1 heartbeat-2.1.3]# cp haresources /etc/ha.d/ 3.查看本机的名字（提前改好） [root@s1 heartbeat-2.1.3]# uname -n s1.ncist.cn 4.编辑配置文件 [root@s1 heartbeat-2.1.3]# cd /etc/ha.d [root@s1 ha.d]# vi ha.cf logfile /var/log/ha-log keepalive 2 deadtime 30 warntime 10 initdead 120 udpport 694 [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-230" title="_r1_c1" src="http://www.ipcpu.com/wp-content/uploads/2009/11/r1_c11.jpg" alt="_r1_c1" width="480" height="95" /></p>
<p>先按照老师的来吧，先用下<span class='wp_keywordlink_affiliate'><a href="http://www.ipcpu.com/tag/heartbeat/" title="View all posts in Heartbeat" target="_blank">Heartbeat</a></span>，LVS和keepalived到实验室再做吧。<br />
实验拓扑图如下：</p>
<p><a href="http://www.ipcpu.com/wp-content/uploads/2010/06/ha.jpg"><img class="aligncenter size-full wp-image-583" title="ha" src="http://www.ipcpu.com/wp-content/uploads/2010/06/ha.jpg" alt="" width="480" height="266" /></a></p>
<p><strong>1.安装heartbeat</strong>，我这里用的yum，装了2遍，不知怎回事。<br />
[root@s1 ~]# yum install nginx<br />
<strong>2.把配置文件复制到/etc/ha.d</strong><br />
[root@s1 ~]# cd /usr/share/doc/heartbeat-2.1.3/<br />
[root@s1 heartbeat-2.1.3]# cp ha.cf /etc/ha.d/<br />
[root@s1 heartbeat-2.1.3]# cp authkeys /etc/ha.d/<br />
[root@s1 heartbeat-2.1.3]# cp haresources /etc/ha.d/<span id="more-228"></span><br />
<strong>3.查看本机的名字（提前改好）</strong><br />
[root@s1 heartbeat-2.1.3]# uname -n<br />
s1.ncist.cn<br />
<strong>4.编辑配置文件</strong><br />
[root@s1 heartbeat-2.1.3]# cd /etc/ha.d<br />
[root@s1 ha.d]# vi ha.cf<br />
logfile /var/log/ha-log<br />
keepalive 2<br />
deadtime 30<br />
warntime 10<br />
initdead 120<br />
udpport 694<br />
bcast   eth1<br />
ucast eth1 192.168.0.20<br />
node    s1.ncist.cn<br />
node    s2.ncist.cn<br />
ping 192.168.128.2</p>
<p>[root@s1 ha.d]# vi authkeys<br />
auth 1<br />
1 crc</p>
<p>[root@s1 ha.d]# vi haresources<br />
s1.ncist.cn 192.168.128.5 httpd</p>
<p><strong>5.编辑hosts文件</strong><br />
[root@s1 ha.d]# vi /etc/hosts</p>
<p>192.168.128.4 s2.ncist.cn<br />
192.168.128.3 s1.ncist.cn</p>
<p><strong>6.启动服务</strong></p>
<p>[root@s1 ha.d]# chmod 600 authkeys<br />
[root@s1 ha.d]# service heartbeat start</p>
<p>S2的配置基本一致，心跳检测改为192.168.0.10</p>
<p>OK，启动测试,<br />
S1虚拟出来的网卡</p>
<p>eth0:0    Link encap:Ethernet  HWaddr 00:0C:29:1C:9A:9D <br />
          inet addr:192.168.128.5  Bcast:192.168.128.255 </p>
<p>S1关掉，S2自动接替，由于用虚拟机做的效果不好，改天实验室真机实验。</p>
<p>参考资料：<a href="http://0451861.blog.51cto.com/133006/130900">http://0451861.blog.51cto.com/133006/130900</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ipcpu.com/2009/11/heartbeat-dual-machine-hotbackup/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
