<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[张宴的博客]]></title> 
<link>http://zyan.cc/index.php</link> 
<description><![CDATA[Web系统架构与底层研发]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[张宴的博客]]></copyright>
<item>
<link>http://zyan.cc/post/348/</link>
<title><![CDATA[利用NetScaler和自行编写的健康检查脚本，完美解决多台MySQL Slave数据库的负载均衡[原创]]]></title> 
<author>张宴 &lt;net@s135.com&gt;</author>
<category><![CDATA[系统架构与硬件]]></category>
<pubDate>Thu, 29 May 2008 15:21:04 +0000</pubDate> 
<guid>http://zyan.cc/post/348/</guid> 
<description>
<![CDATA[ 
	　　[文章作者：张宴 本文版本：v1.1 最后修改：2008.07.17 转载请注明出自：<a href="http://blog.zyan.cc" target="_blank">http://blog.zyan.cc</a>]<br/><br/>　　Citrix NetScaler是一款不错的4-7层硬件负载均衡交换机，市场占有率仅次于F5 BIG-IP，位居第二。NetScaler 8.0是<a href="http://www.citrix.com.cn/" target="_blank">美国思杰系统有限公司</a>（Citrix Systems, Inc）正式推出的最新版本NetScaler产品系列。<br/><br/>　　从我的实际测试来看，NetScaler 8.0在七层负载均衡方面，性能和功能都要比F5 BIG-IP强。<br/><br/>　　NetScaler 8.0的负载均衡监控中，可以对MySQL数据库进行健康检查，而F5 BIG-IP目前只支持对Oracle和Microsoft SQL Server数据库的健康检查。<br/><br/>　　<a href="http://zyan.cc/attachment/200805/nsmysql-slave.png" target="_blank"><img src="http://zyan.cc/attachment/200805/nsmysql-slave.png" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/><br/>　　但是，NetScaler 8.0自带的MySQL健康检查脚本（nsmysql.pl）并不完善，它只能检查一条SQL语句执行是否出错，并不能检查MySQL主从结构中的MySQL Slave数据库同步是否正常、表有无损坏、同步延迟是否过大、是否出现错误、非sleeping状态的连程数是否过高等情况。于是，我根据自己的需要，为NetScaler 8.0写了一个MySQL Slave数据库负载均衡健康检查脚本（nsmysql-slave.pl），实现了上述需求。<br/><br/>　　有了“nsmysql-slave.pl”做健康检查，利用NetScaler的VIP（虚拟IP），就可以完美实现多台MySQL Slave数据库的负载均衡了。当一台MySQL Slave数据库出现不同步、表损坏、同步延迟过大（本脚本中默认设置的落后MySQL主库600秒视为延迟，可根据具体应用修改）、活动连程数太高（本脚本中默认设置的是大于200视为连程数太高，可根据具体应用修改）等情况，“nsmysql-slave.pl”就会自动将其检查出来，并告知NetScaler，NetScaler会将该数据库标识为宕机，从而不将用户的查询请求传送到这台发生故障的数据库上。故障一旦修复，“nsmysql-slave.pl”会自动告知NetScaler，该数据库已经可以使用。<br/><br/>　　“nsmysql-slave.pl”源代码如下：<br/>............<br/><br/>Tags - <a href="http://zyan.cc/tags/linux/" rel="tag">linux</a> , <a href="http://zyan.cc/tags/mysql/" rel="tag">mysql</a> , <a href="http://zyan.cc/tags/citrix/" rel="tag">citrix</a> , <a href="http://zyan.cc/tags/netscaler/" rel="tag">netscaler</a> , <a href="http://zyan.cc/tags/f5/" rel="tag">f5</a> , <a href="http://zyan.cc/tags/big-ip/" rel="tag">big-ip</a>
]]>
</description>
</item><item>
<link>http://zyan.cc/post/348/#blogcomment1098</link>
<title><![CDATA[[评论] 利用NetScaler和自行编写的健康检查脚本，完美解决多台MySQL Slave数据库的负载均衡[原创]]]></title> 
<author>chancey &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Fri, 30 May 2008 09:08:57 +0000</pubDate> 
<guid>http://zyan.cc/post/348/#blogcomment1098</guid> 
<description>
<![CDATA[ 
	replication 的 master 跟 slave 可以不是一种存储引擎？
]]>
</description>
</item><item>
<link>http://zyan.cc/post/348/#blogcomment1100</link>
<title><![CDATA[[评论] 利用NetScaler和自行编写的健康检查脚本，完美解决多台MySQL Slave数据库的负载均衡[原创]]]></title> 
<author>dd_macle &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Fri, 30 May 2008 12:58:04 +0000</pubDate> 
<guid>http://zyan.cc/post/348/#blogcomment1100</guid> 
<description>
<![CDATA[ 
	现在每天都来关注你的博客，你写的文章真是非常详细，支持！！
]]>
</description>
</item><item>
<link>http://zyan.cc/post/348/#blogcomment1126</link>
<title><![CDATA[[评论] 利用NetScaler和自行编写的健康检查脚本，完美解决多台MySQL Slave数据库的负载均衡[原创]]]></title> 
<author>johnzw &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Wed, 04 Jun 2008 02:52:38 +0000</pubDate> 
<guid>http://zyan.cc/post/348/#blogcomment1126</guid> 
<description>
<![CDATA[ 
	你这个想法是可以的，但是我还是感觉有点怪。你这样写了以后，那么如果mysql服务器之间出现问题了话，谁会知道？netscaler 可以发现这个问题，然后把问题服务器cut掉，然后呢？你们监控netscaler的见面吗？ mysql之间做同步应该有一个脚本或守护在跑吧，一旦出现问题会及时发送警报给监控的。<br/><br/>“但是，NetScaler 8.0自带的MySQL健康检查脚本（nsmysql.pl）并不完善，它只能检查一条SQL语句执行是否出错，并不能检查MySQL主从结构中的MySQL Slave数据库同步是否正常、表有无损坏、同步延迟是否过大、是否出现错误、非sleeping状态的连程数是否过高等情况。”<br/><br/>你的意思是当多台mysql slave库提供读操作时，有可能因为同步异常问题导致前台读取的数据有误？<br/>这个不太理解，这应该是基本的数据库原理。我不知道这种错误是否会真实存在，没有解决方案？
]]>
</description>
</item><item>
<link>http://zyan.cc/post/348/#blogcomment1130</link>
<title><![CDATA[[评论] 利用NetScaler和自行编写的健康检查脚本，完美解决多台MySQL Slave数据库的负载均衡[原创]]]></title> 
<author>张宴 &lt;net@s135.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 05 Jun 2008 01:38:07 +0000</pubDate> 
<guid>http://zyan.cc/post/348/#blogcomment1130</guid> 
<description>
<![CDATA[ 
	<div class="quote"><div class="quote-title">引用</div><div class="quote-content">johnzw<br/>你的意思是当多台mysql slave库提供读操作时，有可能因为同步异常问题导致前台读取的数据有误？<br/>这个不太理解，这应该是基本的数据库原理。我不知道这种错误是否会真实存在，没有解决方案？ </div></div><br/>数据库同步出错、MyISAM某张表坏、update同步锁表导致select查询被大量阻塞的问题，在实际应用中经常存在，为了保证前台读取的数据正常，不影响用户正常访问，利用nsmysql-slave.pl的健康检查解决了这个问题。<br/><br/>至于数据库发生故障，报警给监控人员，则由我目前正在编写的另一套专用监控系统来负责。目前已经实现邮件报警、MSN机器人报警。手机短信报警接口积极写完。<br/><br/><img src="http://zyan.cc/template/RuiPai/images/viewimage.gif" alt=""/><a href="http://zyan.cc/attachment/200806/monitor01.png" target="_blank">点击在新窗口中浏览此图片</a><br/><a href="http://zyan.cc/attachment/200806/monitor01.png" target="_blank">http://zyan.cc/attachment/200806/monitor01.png</a><br/><br/><br/><img src="http://zyan.cc/template/RuiPai/images/viewimage.gif" alt=""/><a href="http://zyan.cc/attachment/200806/monitor02.png" target="_blank">点击在新窗口中浏览此图片</a><br/><a href="http://zyan.cc/attachment/200806/monitor02.png" target="_blank">http://zyan.cc/attachment/200806/monitor02.png</a><br/>
]]>
</description>
</item><item>
<link>http://zyan.cc/post/348/#blogcomment1168</link>
<title><![CDATA[[评论] 利用NetScaler和自行编写的健康检查脚本，完美解决多台MySQL Slave数据库的负载均衡[原创]]]></title> 
<author>metoo &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Wed, 11 Jun 2008 05:20:41 +0000</pubDate> 
<guid>http://zyan.cc/post/348/#blogcomment1168</guid> 
<description>
<![CDATA[ 
	bigip 从9.3以后的版本里，也内置有mysql的客户端。可以通过脚本方式来检查mysql 服务器的状态。mysql 服务器的负载均横F5也已经有过案例了。我对这句话比较感兴趣：<br/><br/>“从我的实际测试来看，NetScaler 8.0在七层负载均衡方面，性能和功能都要比F5 BIG-IP强。”<br/><br/>能否找时间聊聊？你到<a href="http://www.adntech.com" target="_blank">www.adntech.com</a>上就能找到我。我请客吃饭一顿。。。
]]>
</description>
</item><item>
<link>http://zyan.cc/post/348/#blogcomment1244</link>
<title><![CDATA[[评论] 利用NetScaler和自行编写的健康检查脚本，完美解决多台MySQL Slave数据库的负载均衡[原创]]]></title> 
<author>wangyi &lt;wangyi.us@gmail.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 26 Jun 2008 07:09:35 +0000</pubDate> 
<guid>http://zyan.cc/post/348/#blogcomment1244</guid> 
<description>
<![CDATA[ 
	我不赞同博主的观点。<br/>我在用过NetScaler 跟 BIGIP后，认为各有特色。<br/>先看低端平台<br/>从4层性能上来说，BIGIP是要强于Netscaler的（除了最低端的bigip只有cpu，没有np。）<br/>7层的性能，bigip的某些型号实际处理能力只有1G，打开bigip低端型号的机箱，你能看到其前端交换板与后端7层处理板之间是一个GE的光纤，因此其理论最大值为1G。<br/>4层性能netscaler完全没的比，与bigip差距太大。<br/>7层性能对于netscaler来说，与其4层相差不大，因为都是同一个处理器，你打开netsclaer的机箱，观察其主板从Interface到处理器之间的电路，能明显看出来其4、7层处理芯片是同一个。因此netscaler的大多数型号7层处理能力也不会比bigip强。<br/>当然不排除netscaler的某些新的信号改变了硬件架构。<br/>在实际应用中，总是4层7层的处理都有的，因此从架构上来说，bigip要优于netsclaer。<br/><br/>对于高端平台<br/>高端平台上，单port的4层处理上，各个厂家的处理并没有显著差距，毕竟都是boardcom的44G芯片一颗，要比较也是看谁舍得多用几颗芯片。同理对f5而言纯7层处理是需要cpu来做的，而大多数可以靠np完成，还有一些4层芯片即可处理。<br/>这样做成一个层次化的处理芯片群组，比单纯的双核、多核或者多CPU的架构要先进，不同的芯片在处理不同的数据时，其效率是不一样的<br/>因此，netsclaer 利用通用cpu来处理的话，在7层处理上更加灵活一些，但bigip并不比netsclaer差，唯一的区别就是一部分用np一部分用cpu处理，两相比较，就要根据应用来决定哪款产品更合适了。<br/>总结就是，两个产品各有特色，但f5的bigip更胜一筹，因为毕竟大多数网络及应用都是4、7层都要处理的。
]]>
</description>
</item><item>
<link>http://zyan.cc/post/348/#blogcomment1246</link>
<title><![CDATA[[评论] 利用NetScaler和自行编写的健康检查脚本，完美解决多台MySQL Slave数据库的负载均衡[原创]]]></title> 
<author>huifeideluotuo &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 26 Jun 2008 10:55:54 +0000</pubDate> 
<guid>http://zyan.cc/post/348/#blogcomment1246</guid> 
<description>
<![CDATA[ 
	有2个疑点要请问楼主<br/><br/>1，你的DB--MASTER和DB--BACKUP是如何保证高可用性的，也是用数据同步吗？<br/>2，从库采用MYISAM引擎，我这里经常碰到数据表损坏的情况，而且修复起来比较麻烦，不知道楼主如何解决？
]]>
</description>
</item><item>
<link>http://zyan.cc/post/348/#blogcomment2364</link>
<title><![CDATA[[评论] 利用NetScaler和自行编写的健康检查脚本，完美解决多台MySQL Slave数据库的负载均衡[原创]]]></title> 
<author>victor &lt;kubryjsc@163.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Sun, 04 Jan 2009 07:25:06 +0000</pubDate> 
<guid>http://zyan.cc/post/348/#blogcomment2364</guid> 
<description>
<![CDATA[ 
	F5 bigip低端的1500和中端的3400，以及netscaler的ns 7000，还有notel的alteon我都用过，citrix的厂商以及你都说它的七层负载能力比F5强，可以把测试结果发出来看看否？<br/><br/>另外，据我所知，F5的很多功能都是由license控制的，比如cache之类的功能，不知道你们的设备是否购买了那台设备所有支持的功能
]]>
</description>
</item><item>
<link>http://zyan.cc/post/348/#blogcomment3517</link>
<title><![CDATA[[评论] 利用NetScaler和自行编写的健康检查脚本，完美解决多台MySQL Slave数据库的负载均衡[原创]]]></title> 
<author>DSF &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Sun, 21 Jun 2009 10:11:07 +0000</pubDate> 
<guid>http://zyan.cc/post/348/#blogcomment3517</guid> 
<description>
<![CDATA[ 
	<a href="http://www.jkzhoucheng.cn/" target="_blank">轴承</a>
]]>
</description>
</item><item>
<link>http://zyan.cc/post/348/#blogcomment3518</link>
<title><![CDATA[[评论] 利用NetScaler和自行编写的健康检查脚本，完美解决多台MySQL Slave数据库的负载均衡[原创]]]></title> 
<author>fwer &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Sun, 21 Jun 2009 10:22:20 +0000</pubDate> 
<guid>http://zyan.cc/post/348/#blogcomment3518</guid> 
<description>
<![CDATA[ 
	<a href="http://www.skffagnsk.cn" target="_blank">轴承</a>
]]>
</description>
</item><item>
<link>http://zyan.cc/post/348/#blogcomment5996</link>
<title><![CDATA[[评论] 利用NetScaler和自行编写的健康检查脚本，完美解决多台MySQL Slave数据库的负载均衡[原创]]]></title> 
<author>海龙 &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Mon, 24 May 2010 03:32:56 +0000</pubDate> 
<guid>http://zyan.cc/post/348/#blogcomment5996</guid> 
<description>
<![CDATA[ 
	不错..
]]>
</description>
</item><item>
<link>http://zyan.cc/post/348/#blogcomment7602</link>
<title><![CDATA[[评论] 利用NetScaler和自行编写的健康检查脚本，完美解决多台MySQL Slave数据库的负载均衡[原创]]]></title> 
<author>nadella &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Sun, 09 Jan 2011 14:44:01 +0000</pubDate> 
<guid>http://zyan.cc/post/348/#blogcomment7602</guid> 
<description>
<![CDATA[ 
	<a href="http://www.jkzhoucheng.cn/nadella/nadella.html" target="_blank">NADELLA轴承</a>
]]>
</description>
</item><item>
<link>http://zyan.cc/post/348/#blogcomment8756</link>
<title><![CDATA[[评论] 利用NetScaler和自行编写的健康检查脚本，完美解决多台MySQL Slave数据库的负载均衡[原创]]]></title> 
<author>dresses &lt;lh286227785@hotmail.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 26 Jul 2011 02:19:25 +0000</pubDate> 
<guid>http://zyan.cc/post/348/#blogcomment8756</guid> 
<description>
<![CDATA[ 
	Here are a variety of the empire &lt;a href=&quot;<a href="http://www.romancearound.com/&quot;&gt;dresses&lt;/a&gt;" target="_blank">http://www.romancearound.com/&quot;&gt;dresses&lt;/a&gt;</a>, I want to introduce yourself. The first shoulder chiffon &lt;a href=&quot;<a href="http://www.romancearound.com/bridesmaid-dresses-c-197.html&quot;&gt;bridesmaid" target="_blank">http://www.romancearound.com/bridesmaid-dresses-c-197.html&quot;&gt;bridesmaid</a> dresses&lt;/a&gt; empire style wedding will &lt;a href=&quot;<a href="http://www.romancearound.com/wedding-dresses-trumpet-wedding-dresses-c-180_253.html&quot;&gt;trumpet" target="_blank">http://www.romancearound.com/wedding-dresses-trumpet-wedding-dresses-c-180_253.html&quot;&gt;trumpet</a> wedding dresses&lt;/a&gt;.This Tia cowries, dressed in her wedding day.Chiffon of the empire the best clothes, because they are the size of the drum as complete motion from the wind the site makes it easy to create a plan impression.One romantic flowers floating above shoulder function and help catch the eyes of the cut of the chest and neck problems, so that more comprehensive coverage of physical illusion bust.Clothing do not like big long torso, short legs, or pear-shaped&lt;a href=&quot;<a href="http://www.romancearound.com/bridesmaid-dresses-ankle-length-bridesmaid-dresses-c-197_198.html&quot;&gt;ankle" target="_blank">http://www.romancearound.com/bridesmaid-dresses-ankle-length-bridesmaid-dresses-c-197_198.html&quot;&gt;ankle</a> length bridesmaid dresses&lt;/a&gt; figure.special is also suitable for pregnant brides since the mobility as a dress can accommodate more Many of the abdomen.
]]>
</description>
</item><item>
<link>http://zyan.cc/post/348/#blogcomment8765</link>
<title><![CDATA[[评论] 利用NetScaler和自行编写的健康检查脚本，完美解决多台MySQL Slave数据库的负载均衡[原创]]]></title> 
<author>niseon &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 26 Jul 2011 03:52:57 +0000</pubDate> 
<guid>http://zyan.cc/post/348/#blogcomment8765</guid> 
<description>
<![CDATA[ 
	我想问一下Mysql Backup(InnoDB)这个是如何实现的？
]]>
</description>
</item><item>
<link>http://zyan.cc/post/348/#blogcomment18958</link>
<title><![CDATA[[评论] 利用NetScaler和自行编写的健康检查脚本，完美解决多台MySQL Slave数据库的负载均衡[原创]]]></title> 
<author>coach factory outlet &lt;fgf@hotmail.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 17 May 2012 03:33:53 +0000</pubDate> 
<guid>http://zyan.cc/post/348/#blogcomment18958</guid> 
<description>
<![CDATA[ 
	Today, following half a century, mentor leather-bases <a href="http://www.coachfactoryoutletao.net" target="_blank">coach factory outlet</a> continues to be the delicate craft of leather-based master is accountable for,Would you like to meet more friends, or go with the times? If yes, <a href="http://www.coachfactoryoutletao.net" target="_blank">coach factory online</a> is opening welcome doors to you.in the market you definitely can find various colorways that are designed in as well as the high quality that applied in. For most of you would like to come. So just come to our <a href="http://www.coachfactoryoutletao.net" target="_blank">coach factory outlet online</a> store to choose one.
]]>
</description>
</item>
</channel>
</rss>