<?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>Jean - 记录成长历程 &#187; 集群</title>
	<atom:link href="http://www.zhangyiqun.net/tag/%e9%9b%86%e7%be%a4/feed" rel="self" type="application/rss+xml" />
	<link>http://www.zhangyiqun.net</link>
	<description>让世界更美好一点儿</description>
	<lastBuildDate>Wed, 07 Dec 2011 14:04:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>如何做Tomcat集群和session复制？</title>
		<link>http://www.zhangyiqun.net/870.html</link>
		<comments>http://www.zhangyiqun.net/870.html#comments</comments>
		<pubDate>Thu, 17 Dec 2009 08:50:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web服务器]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[tomcat]]></category>
		<category><![CDATA[集群]]></category>
		<category><![CDATA[高可用]]></category>

		<guid isPermaLink="false">http://www.zhangyiqun.cn/?p=870</guid>
		<description><![CDATA[CentOS release 5.2 (Final) # yum &#8211;disablerepo=* &#8211;enablerepo=c5-media install httpd # yum &#8211;disablerepo=* &#8211;enablerepo=c5-media install tomcat* 注意yum安装的顺序 # vim /etc/tomcat5/tomcat-users.xml &#60;user username=&#8221;ad&#8221; password=&#8221;123&#8243; roles=&#8221;admin,manager&#8221;/&#62; 修改后可测试管理界面 wget http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/source/tomcat-connectors-1.2.28-src.tar.gz #作用是无缝拼接apache与tomcat #tar zxvf tomcat-connectors-1.2.28-src.tar.gz # cat BUILD.txt # pwd /tmp/tomcat-connectors-1.2.28-src/native # ./configure &#8211;with-apxs=/usr/sbin/apxs # make &#38;&#38; make install # cd apache-2.0/ # apxs -i -n mod_jk mod_jk.so # [...]<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="apache与tomcat整合" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.zhangyiqun.net%2F17.html&from=http%3A%2F%2Fwww.zhangyiqun.net%2F870.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">apache与tomcat整合</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[集群]基础" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.zhangyiqun.net%2F54.html&from=http%3A%2F%2Fwww.zhangyiqun.net%2F870.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[集群]基础</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[集群]详解LVS的工作模式之DR的实现" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.zhangyiqun.net%2F49.html&from=http%3A%2F%2Fwww.zhangyiqun.net%2F870.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/10/31/10075736.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[集群]详解LVS的工作模式之DR的实现</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[集群]详解LVS的工作模式之NAT的实现" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.zhangyiqun.net%2F37.html&from=http%3A%2F%2Fwww.zhangyiqun.net%2F870.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2010/10/03/366188.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[集群]详解LVS的工作模式之NAT的实现</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>CentOS release 5.2 (Final)</p>
<blockquote><p># yum &#8211;disablerepo=* &#8211;enablerepo=c5-media install httpd</p>
<p># yum &#8211;disablerepo=* &#8211;enablerepo=c5-media install tomcat*</p></blockquote>
<p>注意yum安装的顺序</p>
<blockquote><p># vim /etc/tomcat5/tomcat-users.xml</p>
<p>&lt;user username=&#8221;ad&#8221; password=&#8221;123&#8243; roles=&#8221;admin,manager&#8221;/&gt;</p></blockquote>
<p><span id="more-870"></span></p>
<p>修改后可测试管理界面</p>
<blockquote><p>wget http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/source/tomcat-connectors-1.2.28-src.tar.gz #作用是无缝拼接apache与tomcat</p>
<p>#tar zxvf tomcat-connectors-1.2.28-src.tar.gz</p>
<p># cat BUILD.txt</p>
<p># pwd<br />
/tmp/tomcat-connectors-1.2.28-src/native</p>
<p># ./configure &#8211;with-apxs=/usr/sbin/apxs</p>
<p># make &amp;&amp; make install</p></blockquote>
<blockquote><p># cd apache-2.0/</p>
<p># apxs -i -n mod_jk mod_jk.so</p>
<p># cd ../../conf/</p></blockquote>
<blockquote><p># cp workers.properties.minimal /etc/httpd/conf/workers.properties  #配置如何工作</p>
<p># vim /etc/httpd/conf.d/jk.conf</p>
<p># Load mod_jk module<br />
LoadModule jk_module modules/mod_jk.so<br />
# Where to find workers.properties<br />
JkWorkersFile conf/workers.properties<br />
# Where to put jk shared memory<br />
JkShmFile     logs/httpd/mod_jk.shm<br />
# Where to put jk logs<br />
JkLogFile logs/mod_jk.log<br />
# Set the jk log level [debug/error/info]<br />
JkLogLevel info<br />
# Select the log format<br />
JkLogStampFormat &#8220;[%a %b %d %H:%M:%S %Y] &#8221;<br />
# JkOptions indicate to send SSL KEY SIZE,<br />
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories<br />
# JkRequestLogFormat set the request format<br />
JkRequestLogFormat &#8220;%w %V %T %R&#8221;<br />
# All requests go to Tomcat by default<br />
JkMount   /*.jsp     wlb<br />
JkMount   /manager/*     wlb</p></blockquote>
<p>此时重启服务并打开localhost/index.jsp ，有内容则表示上一步成功。需要多少节点可根据需要在不同服务器重复上面操作。</p>
<p>如果上面没问题则可继续配置负载均衡集群</p>
<p>根据官方手册，集群前需先有一router机，所以先来配它</p>
<blockquote><p># vim /etc/httpd/conf/workers.properties</p></blockquote>
<blockquote><p># The advanced router LB worker<br />
worker.list=router,jkstatus</p>
<p># Define a &#8216;jkstatus&#8217; worker using status<br />
worker.jkstatus.type=status</p>
<p># Define a worker using ajp13<br />
worker.worker1.port=8009<br />
worker.worker1.host=node1.domain.org<br />
worker.worker1.type=ajp13<br />
worker.worker1.lbfactor=1<br />
# Define preferred failover node for worker1<br />
#worker.worker1.redirect=worker2</p>
<p># Define another worker using ajp13<br />
worker.worker2.port=8009<br />
worker.worker2.host=node2.domain.org<br />
worker.worker2.type=ajp13<br />
worker.worker2.lbfactor=1<br />
# Disable worker2 for all requests except failover<br />
#worker.worker2.activation=disabled</p>
<p># Define the LB worker<br />
worker.router.type=lb<br />
worker.router.balance_workers=worker1,worker2<br />
worker.router.sticky_session=1</p>
<p>重启router机访问jkstatus则可看到效果，截图如下</p></blockquote>
<p><a href="http://www.zhangyiqun.cn/wp-content/uploads/2009/12/tomcat.png" rel="lightbox[870]"><img class="alignnone" title="jkstatus" src="http://www.zhangyiqun.cn/wp-content/uploads/2009/12/tomcat.png" alt="" width="480" height="377" /></a></p>
<p>如果上一步没有问题，那么恭喜你，负载均衡集群已经实现了。现在来完成session复制，当然下面配置要在节点中完成</p>
<blockquote><p># vim /etc/tomcat5/server.xml</p></blockquote>
<p>注释：</p>
<blockquote><p>&lt;Engine name=&#8221;Catalina&#8221; defaultHost=&#8221;localhost&#8221;&gt;</p></blockquote>
<p>添加：</p>
<blockquote><p>&lt;Engine name=&#8221;Standalone&#8221; defaultHost=&#8221;localhost&#8221; jvmRoute=&#8221;节点主机名，如node1.domain.org&#8221;&gt;</p></blockquote>
<p>取消以下字段的注释令Cluster配置生效</p>
<p>&lt;Cluster className=&#8221;org.apache.catalina.cluster.tcp.SimpleTcpCluster&#8221;<br />
managerClassName=&#8221;org.apache.catalina.cluster.session.DeltaManager&#8221;<br />
expireSessionsOnShutdown=&#8221;false&#8221;<br />
useDirtyFlag=&#8221;true&#8221;<br />
notifyListenersOnReplication=&#8221;true&#8221;&gt;</p>
<p>&lt;Membership<br />
className=&#8221;org.apache.catalina.cluster.mcast.McastService&#8221;<br />
mcastAddr=&#8221;228.0.0.4&#8243; 组播地址<br />
mcastPort=&#8221;45564&#8243; 组播端口<br />
mcastFrequency=&#8221;500&#8243;<br />
mcastDropTime=&#8221;3000&#8243;/&gt;<br />
&lt;Receiver 指定网卡如何接收session信息<br />
className=&#8221;org.apache.catalina.cluster.tcp.ReplicationListener&#8221;<br />
tcpListenAddress=&#8221;网卡IP&#8221;<br />
tcpListenPort=&#8221;4001&#8243;<br />
tcpSelectorTimeout=&#8221;100&#8243;<br />
tcpThreadCount=&#8221;6&#8243;/&gt;</p>
<p>&lt;Sender<br />
className=&#8221;org.apache.catalina.cluster.tcp.ReplicationTransmitter&#8221;<br />
replicationMode=&#8221;pooled&#8221;<br />
ackTimeout=&#8221;15000&#8243;<br />
waitForAck=&#8221;true&#8221;/&gt;</p>
<p>&lt;Valve className=&#8221;org.apache.catalina.cluster.tcp.ReplicationValve&#8221;<br />
filter=&#8221;.*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;&#8221;/&gt;</p>
<p>&lt;Deployer className=&#8221;org.apache.catalina.cluster.deploy.FarmWarDeployer&#8221;<br />
tempDir=&#8221;/tmp/war-temp/&#8221;<br />
deployDir=&#8221;/tmp/war-deploy/&#8221;<br />
watchDir=&#8221;/tmp/war-listen/&#8221;<br />
watchEnabled=&#8221;false&#8221;/&gt;</p>
<p>&lt;ClusterListener className=&#8221;org.apache.catalina.cluster.session.ClusterSessionListener&#8221;/&gt;<br />
&lt;/Cluster&gt;</p>
<p><strong>这么长的一段配置看起来确实很恐怖，但是呢需要改的就几处而已，莫慌</strong></p>
<p>接下来为使组播方式生效，增加路由项目</p>
<blockquote><p>#ip ro add 228.0.0.4 dev eth0</p></blockquote>
<p>重启tomcat，之后验证下tomcat工作是否正常，组播是否正常？</p>
<p># tcpdump -i eth0 not port 22<br />
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode<br />
listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes<br />
16:02:47.252607 IP node1.domain.org.45564 &gt; 228.0.0.4.45564: UDP, length 57<br />
16:02:47.756454 IP node1.domain.org.45564 &gt; 228.0.0.4.45564: UDP, length 57<br />
16:02:48.257428 IP node1.domain.org.45564 &gt; 228.0.0.4.45564: UDP, length 57<br />
16:02:48.759068 IP node1.domain.org.45564 &gt; 228.0.0.4.45564: UDP, length 57</p>
<p>在webapps 下新建test 目录<br />
进入test目录下建WEB-INF目录下的web.xml文件，为了防止格式被破坏其代码在</p>
<p>http://docs.google.com/Doc?docid=0Ae1ODIVF3AfNZGRyaGtmam5fMTUwZDdoOGhxY3A&#038;hl=en</p>
<p>再在webapps 下 建立session.jsp</p>
<p>session.jsp的代码也在上面的链接中</p>
<p>此时进入网页手动写一个session，然后关掉当前正在访问节点的tomcat服务并刷新网页，此时session未变。</p>
<p>http://192.168.56.103/test/session.jsp</p>
<p>至此session复制完成。</p>
<p>如有任何疑问在本页面留言即可。</p>
<p>参考文章</p>
<p>http://bbs.linuxtone.org/viewthread.php?tid=1195&#038;highlight=tomcat</p>
<p>http://blind.javaeye.com/blog/527921</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="apache与tomcat整合" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.zhangyiqun.net%2F17.html&from=http%3A%2F%2Fwww.zhangyiqun.net%2F870.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">apache与tomcat整合</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[集群]基础" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.zhangyiqun.net%2F54.html&from=http%3A%2F%2Fwww.zhangyiqun.net%2F870.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[集群]基础</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[集群]详解LVS的工作模式之DR的实现" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.zhangyiqun.net%2F49.html&from=http%3A%2F%2Fwww.zhangyiqun.net%2F870.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/10/31/10075736.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[集群]详解LVS的工作模式之DR的实现</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[集群]详解LVS的工作模式之NAT的实现" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.zhangyiqun.net%2F37.html&from=http%3A%2F%2Fwww.zhangyiqun.net%2F870.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2010/10/03/366188.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[集群]详解LVS的工作模式之NAT的实现</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.zhangyiqun.net/870.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[集群]详解LVS的工作模式之DR的实现</title>
		<link>http://www.zhangyiqun.net/49.html</link>
		<comments>http://www.zhangyiqun.net/49.html#comments</comments>
		<pubDate>Fri, 06 Mar 2009 04:21:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux集群]]></category>
		<category><![CDATA[DR]]></category>
		<category><![CDATA[LVS]]></category>
		<category><![CDATA[集群]]></category>

		<guid isPermaLink="false">http://www.zhangyiqun.cn/?p=49</guid>
		<description><![CDATA[1、除特别说明外，本博客内容皆为原创，可以自由转载传播，但请署名及注明出处，不尊重别人劳动成果的不欢迎； 2、本博客内容遵守“署名-非商业性使用-禁止演绎 2.5 中国大陆”协议； 作者：张逸群 Mail:jeantoe@gmail.com 前言 Linux 服务器集群系统(以下简称 LVS), 是一个由章文嵩博士发起的自由软件项目，现在已经是 Linux 标准内核的一部分。LVS 从 Linux 内核还在 2.0 版本的时代开始，就得到广泛的应用，目前 Linux 的内核已经是 2.6 版，完全内置了 LVS 的各个模块，已经不需要在给内核打任何补丁。 如何配置 DR方式的集群是本文关注的焦点，读者可以将本文当作一篇 Howto 文档， 以一种相对简单的架构让集群“跑起来”，在生产中的应用随着我经验的增加也会陆续添加。 DR方式拓扑图 在dr模式中由realserver直接回复client的请求，流量不经过director所以速度快开销少。需要注意的是无论NAT或者DR方式都要求所有realserver必须和director位于同一个局域网内。 以DR方式部署 实验环境 OS:RHEL5U1 调度算法：rr director 192.168.92.130(DIP) , 192.168.92.132 realserver1 192.168.92.100 realserver2 192.168.92.200 注意：DR方式中的IP全部都是公网IP 配置 director方面 ipvsadm -A -t 192.168.92.132:80 -s rr ipvsadm -a -t [...]<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.zhangyiqun.net%2F37.html&from=http%3A%2F%2Fwww.zhangyiqun.net%2F49.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[集群]详解LVS的工作模式之NAT的实现</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.zhangyiqun.net%2F54.html&from=http%3A%2F%2Fwww.zhangyiqun.net%2F49.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[集群]基础</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.zhangyiqun.net%2F56.html&from=http%3A%2F%2Fwww.zhangyiqun.net%2F49.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[集群]LVS的10个调度算法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.zhangyiqun.net%2F870.html&from=http%3A%2F%2Fwww.zhangyiqun.net%2F49.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">如何做Tomcat集群和session复制？</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal"><span>1、除特别说明外，本博客内容皆为原创，可以自由转载传播，但请署名及注明出处，不尊重别人劳动成果的不欢迎；</span></p>
<p><span>2、本博客内容遵守“</span><a href="http://creativecommons.org/licenses/by-nc-nd/2.5/cn/" target="_blank"><span>署名-非商业性使用-禁止演绎 2.5 中国大陆</span></a><span>”协议；</span></p>
<p>作者：张逸群<br />
Mail:jeantoe@gmail.com</p>
<p>前言<br />
Linux 服务器集群系统(以下简称 LVS), 是一个由章文嵩博士发起的自由软件项目，现在已经是 Linux 标准内核的一部分。LVS 从 Linux 内核还在 2.0 版本的时代开始，就得到广泛的应用，目前<br />
Linux 的内核已经是 2.6 版，完全内置了 LVS 的各个模块，已经不需要在给内核打任何补丁。</p>
<p>如何配置 DR方式的集群是本文关注的焦点，读者可以将本文当作一篇 Howto 文档， 以一种相对简单的架构让集群“跑起来”，在生产中的应用随着我经验的增加也会陆续添加。</p>
<p><span id="more-49"></span></p>
<p><strong>DR方式拓扑图</strong></p>
<p><img class="alignnone" title="DR" src="http://www.linuxvirtualserver.org/VS-DRouting.gif" alt="" width="691" height="661" /></p>
<p>在dr模式中由realserver直接回复client的请求，流量不经过director所以速度快开销少。需要注意的是无论NAT或者DR方式都要求所有realserver必须和director位于同一个局域网内。</p>
<h3>以DR方式部署</h3>
<p><img class="alignnone" title="lvs-dr" src="http://www.zhangyiqun.cn/wp-content/uploads/2009/08/lvs/lvs-dr.jpg" alt="" width="590" height="692" /></p>
<p><strong>实验环境</strong><br />
OS:RHEL5U1<br />
调度算法：rr<br />
director 192.168.92.130(DIP) , 192.168.92.132<br />
realserver1 192.168.92.100<br />
realserver2 192.168.92.200<br />
注意：DR方式中的IP全部都是公网IP</p>
<p><strong>配置</strong></p>
<p>director方面</p>
<blockquote><p>ipvsadm -A -t 192.168.92.132:80 -s rr<br />
ipvsadm -a -t 192.168.92.132:80 -r 192.168.92.100 -g<br />
ipvsadm -a -t 192.168.92.132:80 -r 192.168.92.200 -g<br />
echo 1 &gt; /proc/sys/net/ipv4/ip_forward</p></blockquote>
<p>realserver1和2中的配置</p>
<blockquote><p><strong><span style="font-weight: normal;">i</span><span style="font-weight: normal;">fconfig lo:1 192.168.92.132 netmask 255.255.255.255</span></strong></p>
<p>用lo而不用eth的原因。</p>
<p>eth是外部网络接口，如果配置成192.168.0.vip将导致ip地址冲突。</p>
<p>在realserver中关闭arp</p>
<p>echo 1 &gt; /proc/sys/net/ipv4/conf/eth0/arp_ignore</p>
<p>echo 2 &gt; /proc/sys/net/ipv4/conf/eth0/arp_announce</p>
<p>echo 1 &gt; /proc/sys/net/ipv4/conf/lo/arp_ignore</p>
<p>echo 2 &gt; /proc/sys/net/ipv4/conf/lo/arp_announce</p>
<p>永久修改以上位置 vim /etc/sysctl.conf</p>
<p>格式net.ipv4.conf.eth0.arp_ignore</p></blockquote>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.zhangyiqun.net%2F37.html&from=http%3A%2F%2Fwww.zhangyiqun.net%2F49.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[集群]详解LVS的工作模式之NAT的实现</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.zhangyiqun.net%2F54.html&from=http%3A%2F%2Fwww.zhangyiqun.net%2F49.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[集群]基础</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.zhangyiqun.net%2F56.html&from=http%3A%2F%2Fwww.zhangyiqun.net%2F49.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[集群]LVS的10个调度算法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.zhangyiqun.net%2F870.html&from=http%3A%2F%2Fwww.zhangyiqun.net%2F49.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">如何做Tomcat集群和session复制？</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.zhangyiqun.net/49.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[集群]详解LVS的工作模式之NAT的实现</title>
		<link>http://www.zhangyiqun.net/37.html</link>
		<comments>http://www.zhangyiqun.net/37.html#comments</comments>
		<pubDate>Thu, 05 Mar 2009 09:57:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux集群]]></category>
		<category><![CDATA[LVS]]></category>
		<category><![CDATA[NAT]]></category>
		<category><![CDATA[笔记]]></category>
		<category><![CDATA[集群]]></category>

		<guid isPermaLink="false">http://www.zhangyiqun.cn/?p=37</guid>
		<description><![CDATA[1、除特别说明外，本博客内容皆为原创，可以自由转载传播，但请署名及注明出处，不尊重别人劳动成果的不欢迎； 2、本博客内容遵守“署名-非商业性使用-禁止演绎 2.5 中国大陆”协议； 作者：张逸群 Mail:jeantoe@gmail.com 前言 Linux 服务器集群系统(以下简称 LVS), 是一个由章文嵩博士发起的自由软件项目，现在已经是 Linux 标准内核的一部分。LVS 从 Linux 内核还在 2.0 版本的时代开始，就得到广泛的应用，目前 Linux 的内核已经是 2.6 版，完全内置了 LVS 的各个模块，已经不需要在给内核打任何补丁。 如何配置 NAT方式的集群是本文关注的焦点，读者可以将本文当作一篇 Howto 文档， 以一种相对简单的架构让集群“跑起来”，在生产中的应用随着我经验的增加也会陆续添加。 NAT方式拓扑图 使用NAT方式时，director同时是一台NAT网关，它必须有一个公网IP，当收到请求时按照调度算法把请求转发给局域网中的某台realserver，realserver处理完请求后把结果返回给director，此时director将结果返回给client。 因为NAT方式完全依赖于director，需要d机有较强的数据吞吐，同时这也导致了d成为一个瓶颈。根据官方的文档当realserver少于20台时用NAT比较合适。 以NAT方式搭建 实验环境 OS:RHEL5U1 调度算法：rr director 192.168.1.254 , 192.168.92.132 (公网) realserver1 192.168.1.100 realserver2 192.168.1.200 安装 yum install ipvsadm 配置 director方面 添加realserver ipvsadm -A -t [...]<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.zhangyiqun.net%2F49.html&from=http%3A%2F%2Fwww.zhangyiqun.net%2F37.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[集群]详解LVS的工作模式之DR的实现</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.zhangyiqun.net%2F54.html&from=http%3A%2F%2Fwww.zhangyiqun.net%2F37.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[集群]基础</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.zhangyiqun.net%2F56.html&from=http%3A%2F%2Fwww.zhangyiqun.net%2F37.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[集群]LVS的10个调度算法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.zhangyiqun.net%2F302.html&from=http%3A%2F%2Fwww.zhangyiqun.net%2F37.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">对skiller原理的探究【5.30更新】</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal"><span>1、除特别说明外，本博客内容皆为原创，可以自由转载传播，但请署名及注明出处，不尊重别人劳动成果的不欢迎；</span></p>
<p><span>2、本博客内容遵守“</span><a href="http://creativecommons.org/licenses/by-nc-nd/2.5/cn/" target="_blank"><span>署名-非商业性使用-禁止演绎 2.5 中国大陆</span></a><span>”协议；</span></p>
<p>作者：张逸群<br />
Mail:jeantoe@gmail.com</p>
<p>前言<br />
Linux 服务器集群系统(以下简称 LVS), 是一个由章文嵩博士发起的自由软件项目，现在已经是 Linux 标准内核的一部分。LVS 从 Linux 内核还在 2.0 版本的时代开始，就得到广泛的应用，目前<br />
Linux 的内核已经是 2.6 版，完全内置了 LVS 的各个模块，已经不需要在给内核打任何补丁。</p>
<p>如何配置 NAT方式的集群是本文关注的焦点，读者可以将本文当作一篇 Howto 文档， 以一种相对简单的架构让集群“跑起来”，在生产中的应用随着我经验的增加也会陆续添加。</p>
<p>NAT方式拓扑图</p>
<p><span id="more-37"></span></p>
<p><img class="alignnone" title="NAT" src="http://www.linuxvirtualserver.org/VS-NAT.gif" alt="" width="649" height="605" /></p>
<p>使用NAT方式时，director同时是一台NAT网关，它必须有一个公网IP，当收到请求时按照<strong>调度算法</strong>把请求转发给局域网中的某台realserver，realserver处理完请求后把结果返回给director，此时director将结果返回给client。<br />
<span lang="EN-US">因为NAT</span><span>方式完全依赖于</span><span lang="EN-US">director</span><span>，需要d机有较强的数据吞吐，同时这也导致了</span><span lang="EN-US">d</span><span>成为一个瓶颈。根据官方的文档当realserver少于20台时用NAT比较合适。</span></p>
<h3>以NAT方式搭建</h3>
<p><img class="alignnone" title="lvs-nat" src="http://www.zhangyiqun.cn/wp-content/uploads/2009/08/lvs/lvs-nat.jpg" alt="" width="439" height="335" /></p>
<p><strong>实验环境</strong></p>
<blockquote><p>OS:RHEL5U1<br />
调度算法：rr<br />
director 192.168.1.254 , 192.168.92.132 (公网)<br />
realserver1 192.168.1.100<br />
realserver2 192.168.1.200</p></blockquote>
<p><strong>安装</strong></p>
<blockquote><p>yum install ipvsadm</p></blockquote>
<p><strong>配置</strong></p>
<p>director方面</p>
<p>添加realserver</p>
<blockquote><p>ipvsadm -A -t 192.168.92.132:80 -s rr 192.168.1.254<br />
ipvsadm -a -t 192.168.92.132:80 -r 192.168.1.100 -m<br />
ipvsadm -a -t 192.168.92.132:80 -r 192.168.1.200 -m<br />
ipvsadm -Ln #显示列表，看是否添加成功</p></blockquote>
<p>开启ip转发</p>
<blockquote><p>cat /proc/sys/net/ipv4/ip_forward<br />
echo &#8220;1&#8243; &gt;/proc/sys/net/ipv4/ip_forward</p></blockquote>
<p>到此director配置完毕。</p>
<p>realserver1的配置</p>
<blockquote><p>route add default dev eth0 gw 192.168.1.254<br />
echo &#8220;0&#8243; &gt;/proc/sys/net/ipv4/ip_forward</p></blockquote>
<p>realserver2的配置</p>
<blockquote><p>route add default dev eth0 gw 192.168.1.254<br />
echo &#8220;0&#8243; &gt;/proc/sys/net/ipv4/ip_forward</p></blockquote>
<p>到此LVS集群配置完毕，可以跑服务测试！我这里用web服务做测试，因为效果比较明显。<br />
<img class="alignnone" title="ipvsadm" src="http://www.zhangyiqun.cn/wp-content/uploads/2009/image/cluser/ipvsadm.gif" alt="" width="671" height="159" /></p>
<p>注意：不要使用firefox或者google的抽魔浏览器，缓存会让你看不到效果的。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.zhangyiqun.net%2F49.html&from=http%3A%2F%2Fwww.zhangyiqun.net%2F37.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[集群]详解LVS的工作模式之DR的实现</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.zhangyiqun.net%2F54.html&from=http%3A%2F%2Fwww.zhangyiqun.net%2F37.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[集群]基础</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.zhangyiqun.net%2F56.html&from=http%3A%2F%2Fwww.zhangyiqun.net%2F37.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">[集群]LVS的10个调度算法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.zhangyiqun.net%2F302.html&from=http%3A%2F%2Fwww.zhangyiqun.net%2F37.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">对skiller原理的探究【5.30更新】</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.zhangyiqun.net/37.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[集群]基础</title>
		<link>http://www.zhangyiqun.net/54.html</link>
		<comments>http://www.zhangyiqun.net/54.html#comments</comments>
		<pubDate>Wed, 04 Mar 2009 16:26:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux集群]]></category>
		<category><![CDATA[LVS]]></category>
		<category><![CDATA[基础]]></category>
		<category><![CDATA[集群]]></category>

		<guid isPermaLink="false">http://www.zhangyiqun.cn/?p=54</guid>
		<description><![CDATA[1.请简要什么是集群技术？为什么要使用集群技术？ 集群是一组协同工作的服务实体，用以提供比单一服务实体更具扩展性和可用性的服务平台。 2.请说出你所知道的集群种类，和实现方案？ 目前Linux下的集群主要有三种类型  1. HA (High Availability)  2. LB (Load Balancing)  3. HPC (High performance Computing)  ○ DC (Distributed Computing)  ○ PC (Parallel Computing) 高性能计算集群（High Performance Compute clustering）（如 Beowulf）使用多个机器来为需要大量计算能力的任务提供更强大的计算能力。RHEL没有内嵌这类集群的解决方案。  高可用性集群（High-availability clustering）使用多个机器来为某个服务或某组服务提供额外的可靠性。  负载均衡集群（Load-balance clustering）使用特殊的路由技术来给一组服务器分配任务。  RedHat提供了后两种集群技术的解决方案。使用一组程序来监视该系统和集群中的服务的健康状况。 虽然集群系统并不能解决所有的系统问题，但是它能够帮助系统管理员最大限度地利用现有的资源。并不是所有的程序都适用于集群系统，但是常见的系统应用如HTTP服务，FTP服务，数据库服务都可以利用集群系统来增强它们的功能。 3.什么时候需要用LB集群？ 公共WEB服务、FTP服务、数据库服务等高负载服务中。 4.什么时候需要使用HA集群？ Ha集群主要用于文件服务，WEB服务，数据库服务等关键应用中 5.Linux下实现LB集群的项目是？ 目前在LINUX系统下使用最为广泛的LB集群系统为LVS<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="[集群]详解LVS的工作模式之DR的实现" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.zhangyiqun.net%2F49.html&from=http%3A%2F%2Fwww.zhangyiqun.net%2F54.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/10/31/10075736.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[集群]详解LVS的工作模式之DR的实现</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[集群]详解LVS的工作模式之NAT的实现" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.zhangyiqun.net%2F37.html&from=http%3A%2F%2Fwww.zhangyiqun.net%2F54.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2010/10/03/366188.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[集群]详解LVS的工作模式之NAT的实现</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Linux时间戳转换" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.zhangyiqun.net%2F1622.html&from=http%3A%2F%2Fwww.zhangyiqun.net%2F54.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Linux时间戳转换</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="用Wget抓目录" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.zhangyiqun.net%2F1386.html&from=http%3A%2F%2Fwww.zhangyiqun.net%2F54.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">用Wget抓目录</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>1.请简要什么是集群技术？为什么要使用集群技术？</p>
<blockquote><p>集群是一组协同工作的服务实体，用以提供比单一服务实体<strong>更具扩展性和可用性</strong>的服务平台。</p></blockquote>
<p>2.请说出你所知道的集群种类，和实现方案？</p>
<blockquote><p>目前Linux下的集群主要有三种类型 </p>
<p>1. HA (High Availability) </p>
<p>2. LB (Load Balancing) </p>
<p>3. HPC (High performance Computing) </p>
<p>○ DC (Distributed Computing) </p></blockquote>
<blockquote><p>○ PC (Parallel Computing)</p></blockquote>
<p><span id="more-54"></span></p>
<p>高性能计算集群（High Performance Compute clustering）（如 Beowulf）使用多个机器来为需要大量计算能力的任务提供更强大的计算能力。RHEL没有内嵌这类集群的解决方案。 </p>
<p>高可用性集群（High-availability clustering）使用多个机器来为某个服务或某组服务提供额外的可靠性。 </p>
<p>负载均衡集群（Load-balance clustering）使用特殊的路由技术来给一组服务器分配任务。 </p>
<p>RedHat提供了后两种集群技术的解决方案。使用一组程序来监视该系统和集群中的服务的健康状况。</p>
<p>虽然集群系统并不能解决所有的系统问题，但是它能够帮助系统管理员最大限度地利用现有的资源。并不是所有的程序都适用于集群系统，但是常见的系统应用如HTTP服务，FTP服务，数据库服务都可以利用集群系统来增强它们的功能。</p>
<p>3.什么时候需要用LB集群？</p>
<blockquote><p>公共WEB服务、FTP服务、数据库服务等高负载服务中。</p></blockquote>
<p>4.什么时候需要使用HA集群？</p>
<blockquote><p>Ha集群主要用于文件服务，WEB服务，数据库服务等关键应用中</p></blockquote>
<p>5.Linux下实现LB集群的项目是？</p>
<blockquote><p>目前在LINUX系统下使用最为广泛的LB集群系统为LVS</p></blockquote>
<p style="margin:0;padding:0;height:1px;overflow:hidden;">
    <script type="text/javascript"><!--
        var wumiiSitePrefix = "http://www.zhangyiqun.net";
        var wumiiEnableCustomPos = false;
        var wumiiParams = "&#038;num=4&#038;mode=3&#038;displayInFeed=1&#038;version=1.0.5.5&#038;pf=WordPress3.2.1";
    //--></script><script type="text/javascript" src="http://widget.wumii.com/ext/relatedItemsWidget.htm"></script><a href="http://www.wumii.com/widget/relatedItems.htm" style="border:0;"><img src="http://static.wumii.com/images/pixel.png" alt="无觅相关文章插件，快速提升流量" style="border:0;padding:0;margin:0;" /></a></p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="[集群]详解LVS的工作模式之DR的实现" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.zhangyiqun.net%2F49.html&from=http%3A%2F%2Fwww.zhangyiqun.net%2F54.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/10/31/10075736.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[集群]详解LVS的工作模式之DR的实现</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="[集群]详解LVS的工作模式之NAT的实现" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.zhangyiqun.net%2F37.html&from=http%3A%2F%2Fwww.zhangyiqun.net%2F54.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2010/10/03/366188.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">[集群]详解LVS的工作模式之NAT的实现</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Linux时间戳转换" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.zhangyiqun.net%2F1622.html&from=http%3A%2F%2Fwww.zhangyiqun.net%2F54.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Linux时间戳转换</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="用Wget抓目录" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.zhangyiqun.net%2F1386.html&from=http%3A%2F%2Fwww.zhangyiqun.net%2F54.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">用Wget抓目录</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.zhangyiqun.net/54.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced

Served from: www.zhangyiqun.net @ 2012-02-09 12:14:56 -->
