<?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"
	>

<channel>
	<title>苏小勇的blog</title>
	<atom:link href="http://blog.bestunix.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.bestunix.net</link>
	<description></description>
	<pubDate>Thu, 14 Aug 2008 14:25:51 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>几个linux集群节点的辅助管理工具</title>
		<link>http://blog.bestunix.net/2008/08/linux-cluster-node-administrative-tools/</link>
		<comments>http://blog.bestunix.net/2008/08/linux-cluster-node-administrative-tools/#comments</comments>
		<pubDate>Thu, 14 Aug 2008 14:24:51 +0000</pubDate>
		<dc:creator>Su Xiaoyong</dc:creator>
		
		<category><![CDATA[新知]]></category>

		<category><![CDATA[clusters]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[集群]]></category>

		<guid isPermaLink="false">http://blog.bestunix.net/?p=118</guid>
		<description><![CDATA[集群节点监控: Ganglia
Ganglia is a scalable distributed monitoring system for high-performance comp...]]></description>
			<content:encoded><![CDATA[<h6>集群节点监控: Ganglia</h6>
<p>Ganglia is a scalable distributed monitoring system for high-performance computing systems such as clusters and Grids. It is based on a hierarchical design targeted at federations of clusters. Uses multicast and/or unicast to inject xml data into an rrdtool frontend. Makes it very easy to make custom graphs as it was originally written to handle stats data from HPC clusters http://ganglia.sourceforge.net/<br />
SystemImager</p>
<h6>节点统一自动安装部署: SystemImager</h6>
<p>SystemImager is software which automates Linux installs, software distribution, and production deployment. SystemImager is a part of System Installation Suite. SystemImager makes it easy to do automated installs (clones), software distribution, content or data distribution, configuration changes, and operating system updates to your network of Linux machines. You can even update from one Linux release version to another! It can also be used to ensure safe production deployments. By saving your current production image before updating to your new production image, you have a highly reliable contingency mechanism. If the new production enviroment is found to be flawed, simply roll-back to the last production image with a simple update command! Some typical environments include: Internet server farms, database server farms, high performance clusters, computer labs, and corporate desktop environments. http://systemimager.org</p>
<h6>使用subversion集中管理配置文件版本:ubcon</h6>
<p>Subcon allows you to store your essential system configuration files in a subversion repository and easily deploy different configurations to machines in a cluster. It also features optional integration with SystemImager, enabling the deployment of system images and configuration in a single step. A flexible configuration file provides the ability to start, stop, or restart services or run arbitrary scripts when a change in a file or set of files is detected. http://code.google.com/p/subcon/</p>
<p>&copy;2008 <a href="http://blog.bestunix.net">苏小勇的blog</a>. All Rights Reserved.</p>.<b>相关文章：</b><br>
<ul><li><a href="http://blog.bestunix.net/2007/11/groovy-website-generator-groovy-site-generator-open-source%c0%b2/" title="Groovy WebSite Generator(Groovy 网站生成器)开源啦">Groovy WebSite Generator(Groovy 网站生成器)开源啦</a></li>
<li><a href="http://blog.bestunix.net/2007/11/sequoia-log/" title="sequoia中的日志">sequoia中的日志</a></li>
<li><a href="http://blog.bestunix.net/2007/11/sequoia%e4%b8%ad%e7%9a%84%e8%87%aa%e5%8a%a8%e6%95%85%e9%9a%9c%e5%a4%84%e7%90%86/" title="sequoia中的自动故障处理">sequoia中的自动故障处理</a></li>
<li><a href="http://blog.bestunix.net/2007/11/sequoia-add-an-synchronized-cluster-node/" title="sequoia中添加和同步集群节点">sequoia中添加和同步集群节点</a></li>
<li><a href="http://blog.bestunix.net/2007/11/several-useful-but-not-commonly-used-method-of-javascript/" title="几个不常用但很有用的javascript方法">几个不常用但很有用的javascript方法</a></li>
<li><a href="http://blog.bestunix.net/2007/11/javascript-and-xhtml-information/" title="关于javascript和xhtml的资料">关于javascript和xhtml的资料</a></li>
<li><a href="http://blog.bestunix.net/2008/07/memcached-install-on-centos/" title="在CentOs中安装Memcached">在CentOs中安装Memcached</a></li>
<li><a href="http://blog.bestunix.net/about/" title="关于">关于</a></li>
<li><a href="http://blog.bestunix.net/2008/01/postgresql-performance-optimization-information/" title="PostgreSQL性能优化相关资料大全">PostgreSQL性能优化相关资料大全</a></li>
<li><a href="http://blog.bestunix.net/2008/08/tomcat-performance-monitor/" title="tomcat性能监控工具 lambda probe">tomcat性能监控工具 lambda probe</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.bestunix.net/2008/08/linux-cluster-node-administrative-tools/feed/</wfw:commentRss>
		</item>
		<item>
		<title>tomcat性能监控工具 lambda probe</title>
		<link>http://blog.bestunix.net/2008/08/tomcat-performance-monitor/</link>
		<comments>http://blog.bestunix.net/2008/08/tomcat-performance-monitor/#comments</comments>
		<pubDate>Thu, 14 Aug 2008 14:12:26 +0000</pubDate>
		<dc:creator>Su Xiaoyong</dc:creator>
		
		<category><![CDATA[新知]]></category>

		<category><![CDATA[tomcat]]></category>

		<category><![CDATA[性能]]></category>

		<category><![CDATA[监控]]></category>

		<guid isPermaLink="false">http://blog.bestunix.net/?p=115</guid>
		<description><![CDATA[lambda probe是一个tomcat性能监控工具，它提供了比tomcat管理控制台更加强大的功能，它自身也是一个web应用...]]></description>
			<content:encoded><![CDATA[<p>lambda probe是一个tomcat性能监控工具，它提供了比tomcat管理控制台更加强大的功能，它自身也是一个web应用，直接部署到tomcat下就可以通过web方式来访问了.</p>
<p>lambda probe提供了非常丰富的功能，下面是它的一些特性：</p>
<p>* Comprehensive JVM memory usage monitor.<br />
* JBoss compatibility<br />
* Display of deployed applications, their status, session count, session object count, context object count, datasource usage etc.<br />
* Start, stop, restart, deploy and updeploy of applications<br />
* Ability to view deployed JSP files<br />
* Ability to compile all or selected JSP files at any time.<br />
* Ability to pre-compile JSP files on application deployment.<br />
* Ability to view auto-generated JSP servlets<br />
* Display of list of sessions for a particular application<br />
* Display of session attributes and their values for a particular application. Ability to remove session attributes.<br />
* Ability to view application context attributes and their values.<br />
* Ability to expire selected sessions<br />
* Graphical display of datasource details including maximum number of connections, number of busy connections and configuration details<br />
* Ability to group datasource properties by URL to help visualizing impact on the databases<br />
* Ability to reset data sources in case of applications leaking connection<br />
* Display of system information including System.properties, memory usage bar and OS details<br />
* Display of JK connector status including the list of requests pending execution<br />
* Real-time connector usage charts and statistics.<br />
* Real-time cluster monitoring and clulster traffic charts<br />
* Real time OS memory usage, swap usage and CPU utilisation monitoring<br />
* Ability to show information about log files and download selected files<br />
* Ability to tail log files in real time from a browser.<br />
* Ability to interrupt execution of &#8220;hang&#8221; requests without server restart<br />
* Ability to restart Tomcat/JVM via Java Serview Wrapper.<br />
* Availability &#8220;Quick check&#8221;</p>
<p>网址: http://www.lambdaprobe.org/d/index.htm</p>
<p>在线演示: http://demo.lambdaprobe.org/ 用户名密码为demo/demo 。</p>
<p>&copy;2008 <a href="http://blog.bestunix.net">苏小勇的blog</a>. All Rights Reserved.</p>.<b>相关文章：</b><br>
<ul><li><a href="http://blog.bestunix.net/2007/11/groovy-website-generator-groovy-site-generator-open-source%c0%b2/" title="Groovy WebSite Generator(Groovy 网站生成器)开源啦">Groovy WebSite Generator(Groovy 网站生成器)开源啦</a></li>
<li><a href="http://blog.bestunix.net/2008/07/memcached-install-on-centos/" title="在CentOs中安装Memcached">在CentOs中安装Memcached</a></li>
<li><a href="http://blog.bestunix.net/2007/10/tomcat6-new-features/" title="tomcat6的新特性">tomcat6的新特性</a></li>
<li><a href="http://blog.bestunix.net/2007/11/sequoia-log/" title="sequoia中的日志">sequoia中的日志</a></li>
<li><a href="http://blog.bestunix.net/2007/11/sequoia%e4%b8%ad%e7%9a%84%e8%87%aa%e5%8a%a8%e6%95%85%e9%9a%9c%e5%a4%84%e7%90%86/" title="sequoia中的自动故障处理">sequoia中的自动故障处理</a></li>
<li><a href="http://blog.bestunix.net/2007/11/sequoia-add-an-synchronized-cluster-node/" title="sequoia中添加和同步集群节点">sequoia中添加和同步集群节点</a></li>
<li><a href="http://blog.bestunix.net/2007/10/several-clusters-in-the-session-synchronization-solutions-compared/" title="集群中几种session同步解决方案的比较">集群中几种session同步解决方案的比较</a></li>
<li><a href="http://blog.bestunix.net/2007/11/javascript-and-xhtml-information/" title="关于javascript和xhtml的资料">关于javascript和xhtml的资料</a></li>
<li><a href="http://blog.bestunix.net/2008/08/linux-cluster-node-administrative-tools/" title="几个linux集群节点的辅助管理工具">几个linux集群节点的辅助管理工具</a></li>
<li><a href="http://blog.bestunix.net/about/" title="关于">关于</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.bestunix.net/2008/08/tomcat-performance-monitor/feed/</wfw:commentRss>
		</item>
		<item>
		<title>在CentOs中安装Memcached</title>
		<link>http://blog.bestunix.net/2008/07/memcached-install-on-centos/</link>
		<comments>http://blog.bestunix.net/2008/07/memcached-install-on-centos/#comments</comments>
		<pubDate>Sun, 27 Jul 2008 03:27:58 +0000</pubDate>
		<dc:creator>Su Xiaoyong</dc:creator>
		
		<category><![CDATA[心得]]></category>

		<category><![CDATA[centos]]></category>

		<category><![CDATA[libevent]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[memcached]]></category>

		<guid isPermaLink="false">http://blog.bestunix.net/2008/07/%e5%9c%a8centos%e4%b8%ad%e5%ae%89%e8%a3%85memcached/</guid>
		<description><![CDATA[&#160;   需要先安装gcc,libevent   yum install gcc    wget http://monkey.org/~provos/libevent-1.4.4-s...]]></description>
			<content:encoded><![CDATA[<h6>准备安装:</h6>
<p>需要先安装gcc,libevent</p>
<p>yum install gcc wget http://monkey.org/~provos/libevent-1.4.4-stable.tar.gz tar xvzf libevent-1.4.4-stable.tar.gz cd libevent-1.4.4-stable ./configure &#8211;prefix=/usr/local/libevent make make install</p>
<h6>编译安装:</h6>
<p>./configure &#8211;prefix=/usr/local/memcached &#8211;build=i686-pc-linux-gnu \ &#8211;with-libevent=/usr/local/libevent make make install</p>
<h6>启动：</h6>
<p>$ /usr/local/memcached/bin/memcached -p 11211 -m 64m -d -u root</p>
<p> </p>
<p>使用memcached -h可以查看所有可用选项:</p>
<ul>
<li>
选项     说明-p     使用的TCP端口。默认为11211</p>
<p>-m     最大内存大小。默认为64M</p>
<p>-vv     用very vrebose模式启动，调试信息和错误输出到控制台</p>
<p>-d     作为daemon在后台启动</li>
<li>-u     运行Memcache的用户，默认不能用root启动，所以当前用户为root用户时，需要用-u参数来指定。</li>
<li>-l       监听的服务器的ip</li>
<li>-c      最大并发连接数，默认为1024</li>
<li>-P     指定pid文件</li>
</ul>
<h6>常见问题：</h6>
<p><strong>1. 编译memcached时出现下面错误：</strong></p>
<p>./configure checking build system type… Invalid configuration `i686-pc-linux-’: machine `i686-pc-linux‘ not recognized configure: error: /bin/sh ./config.sub i686-pc-linux- failed</p>
<p>解决方法：</p>
<p>在./configure 时加入参数&#8211;build=i686-pc-linux-gnu</p>
<p><strong>2.启动时找不到libevent库</strong></p>
<p>memcached: error while loading shared libraries: libevent-1.3c.so.1: cannot open shared object file: No such file or directory </p>
<p>解决办法：</p>
<p>将libevent库所在路径加入LIBRARY_PATH,在/etc/profile中加入</p>

<div class="wp_syntax"><div class="code"><pre class="bash"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LD_LIBRARY_PATH=</span><span style="color: #007800;">$LD_LIBRARY_PATH</span>:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span><span style="color: #000000; font-weight: bold;">/</span>libevent<span style="color: #000000; font-weight: bold;">/</span>lib</pre></div></div>

<p>&copy;2008 <a href="http://blog.bestunix.net">苏小勇的blog</a>. All Rights Reserved.</p>.<b>相关文章：</b><br>
<ul><li><a href="http://blog.bestunix.net/2008/08/linux-cluster-node-administrative-tools/" title="几个linux集群节点的辅助管理工具">几个linux集群节点的辅助管理工具</a></li>
<li><a href="http://blog.bestunix.net/2007/10/hibernate-and-the-integration-memcached/" title="Hibernate 和 memcached 的集成问题">Hibernate 和 memcached 的集成问题</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.bestunix.net/2008/07/memcached-install-on-centos/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PostgreSQL性能优化相关资料大全</title>
		<link>http://blog.bestunix.net/2008/01/postgresql-performance-optimization-information/</link>
		<comments>http://blog.bestunix.net/2008/01/postgresql-performance-optimization-information/#comments</comments>
		<pubDate>Mon, 14 Jan 2008 02:00:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[资料]]></category>

		<category><![CDATA[performance]]></category>

		<category><![CDATA[PostgresSQL]]></category>

		<guid isPermaLink="false">http://sugg.spaces.live.com/Blog/cns!A712BCD987CCDA1B!235.entry</guid>
		<description><![CDATA[
很久没用postgresql了，有点怀念.
PostgreSQL 8.0 Performance Checklist
Tuning PostgreSQL for performance July 3, 2003，covers 7.3 and 7.4
Annotated POSTGRESQL.CONF Guide for PostgreSQL
PostgreSQL Performance Tuning August 1st, 2001
PostgreSQL Hardware Performance Tuning 2003
PostgreSQL Application Performance Tips 1 2006
PostgreSQL Application Performance Tips 2 2006
Performance Tuning PostgreSQL
Performance tuning for PostgreSQL database (Linux) August 10, 2006
Collection of PostgreSQL Performance Tips 25 Apr 2002
PowerPostgreSQL many docs
PostgreSQL [...]]]></description>
			<content:encoded><![CDATA[<div style="padding-right:0px;display:inline;padding-left:0px;padding-bottom:0px;margin:0px;padding-top:0px"><a rel="tag" href="http://technorati.com/tags/performance/"></a></div>
<p>很久没用postgresql了，有点怀念.</p>
<p><a href="http://www.powerpostgresql.com/PerfList" target="_blank">PostgreSQL 8.0 Performance Checklist</a></p>
<p><a href="http://www.varlena.com/GeneralBits/Tidbits/perf.html" target="_blank">Tuning PostgreSQL for performance</a> July 3, 2003，covers 7.3 and 7.4</p>
<p><a href="http://www.powerpostgresql.com/Downloads/annotated_conf_80.html" target="_blank">Annotated POSTGRESQL.CONF Guide for PostgreSQL</a></p>
<p><a href="http://www.linuxjournal.com/article/4791" target="_blank">PostgreSQL Performance Tuning</a> August 1st, 2001</p>
<p><a href="http://www.postgresql.org/files/documentation/books/aw_pgsql/hw_performance/" target="_blank">PostgreSQL Hardware Performance Tuning</a> 2003</p>
<p><a href="http://blogs.ittoolbox.com/database/soup/archives/postgresql-application-performance-tips-part-1-13172" target="_blank">PostgreSQL Application Performance Tips 1</a> 2006</p>
<p><a href="http://blogs.ittoolbox.com/database/soup/archives/postgresql-application-performance-tips-part-2-13194" target="_blank">PostgreSQL Application Performance Tips 2</a> 2006</p>
<p><a href="http://www.revsys.com/writings/postgresql-performance.html" target="_blank">Performance Tuning PostgreSQL</a></p>
<p><a href="http://www.desknow.com/kb/idx/0/061/article/" target="_blank">Performance tuning for PostgreSQL database (Linux)</a> August 10, 2006</p>
<p><a href="http://archives.postgresql.org/pgsql-sql/2002-04/msg00318.php" target="_blank">Collection of PostgreSQL Performance Tips</a> 25 Apr 2002</p>
<p><a href="http://www.powerpostgresql.com/Docs/" target="_blank">PowerPostgreSQL</a> many docs</p>
<p><a href="http://linuxfinances.info/info/postgresqlperformance.html" target="_blank">PostgreSQL Performance Tuning</a></p>
<p><a href="http://archives.postgresql.org/pgsql-performance/" target="_blank">postgresql 性能问题邮件列表</a><img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-6407851677322520037&amp;page=RSS%ef%bc%9aPostgreSQL%e6%80%a7%e8%83%bd%e4%bc%98%e5%8c%96%e7%9b%b8%e5%85%b3%e8%b5%84%e6%96%99%e5%a4%a7%e5%85%a8&amp;referrer=" border="0" alt="" width="1" height="1" /><img style="position:absolute" src="http://c.live.com/c.gif?NC=31263&amp;NA=1149&amp;PI=81873&amp;RF=&amp;DI=3919&amp;PS=85545&amp;TP=sugg.spaces.live.com&amp;GT1=sugg" alt="" width="0" height="0" /></p>
<p>&copy;2008 <a href="http://blog.bestunix.net">苏小勇的blog</a>. All Rights Reserved.</p>.<b>相关文章：</b><br>
<ul><li><a href="http://blog.bestunix.net/2008/08/tomcat-performance-monitor/" title="tomcat性能监控工具 lambda probe">tomcat性能监控工具 lambda probe</a></li>
<li><a href="http://blog.bestunix.net/2007/10/groovy-study-inf/" title="Groovy学习之资料篇">Groovy学习之资料篇</a></li>
<li><a href="http://blog.bestunix.net/2007/11/javascript-and-xhtml-information/" title="关于javascript和xhtml的资料">关于javascript和xhtml的资料</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.bestunix.net/2008/01/postgresql-performance-optimization-information/feed/</wfw:commentRss>
		</item>
		<item>
		<title>关于javascript和xhtml的资料</title>
		<link>http://blog.bestunix.net/2007/11/javascript-and-xhtml-information/</link>
		<comments>http://blog.bestunix.net/2007/11/javascript-and-xhtml-information/#comments</comments>
		<pubDate>Sun, 18 Nov 2007 14:50:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[资料]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[js调试]]></category>

		<category><![CDATA[prototype]]></category>

		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://sugg.spaces.live.com/Blog/cns!A712BCD987CCDA1B!226.entry</guid>
		<description><![CDATA[超全中文资料 http://w3school.com.cn/

api搜索(英文) http://www.gotapi.com/jsdomw3s

prototype扩展...]]></description>
			<content:encoded><![CDATA[<p>超全中文资料 <a title="http://w3school.com.cn/" href="http://w3school.com.cn/" target="_blank">http://w3school.com.cn/</a></p>
<p>api搜索(英文) <a title="http://www.gotapi.com/jsdomw3s" href="http://www.gotapi.com/jsdomw3s" target="_blank">http://www.gotapi.com/jsdomw3s</a></p>
<p>prototype扩展资源大全 <a title="http://www.scripteka.com/" href="http://www.scripteka.com/" target="_blank">http://www.scripteka.com/</a></p>
<p><a href="http://www.my-debugbar.com/wiki/CompanionJS/HomePage" target="_blank">IE下的js调试工具</a></p>
<p><a href="http://www.my-debugbar.com/wiki/ToDo/Beta" target="_blank">IE下的css调试工具</a><img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-6407851677322520037&amp;page=RSS%ef%bc%9a%e5%85%b3%e4%ba%8ejavascript%e5%92%8cxhtml%e7%9a%84%e8%b5%84%e6%96%99&amp;referrer=" border="0" alt="" width="1" height="1" /><img style="position:absolute" src="http://c.live.com/c.gif?NC=31263&amp;NA=1149&amp;PI=81873&amp;RF=&amp;DI=3919&amp;PS=85545&amp;TP=sugg.spaces.live.com&amp;GT1=sugg" alt="" width="0" height="0" /></p>
<p>&copy;2008 <a href="http://blog.bestunix.net">苏小勇的blog</a>. All Rights Reserved.</p>.<b>相关文章：</b><br>
<ul><li><a href="http://blog.bestunix.net/2008/08/linux-cluster-node-administrative-tools/" title="几个linux集群节点的辅助管理工具">几个linux集群节点的辅助管理工具</a></li>
<li><a href="http://blog.bestunix.net/2008/08/tomcat-performance-monitor/" title="tomcat性能监控工具 lambda probe">tomcat性能监控工具 lambda probe</a></li>
<li><a href="http://blog.bestunix.net/about/" title="关于">关于</a></li>
<li><a href="http://blog.bestunix.net/2007/11/several-useful-but-not-commonly-used-method-of-javascript/" title="几个不常用但很有用的javascript方法">几个不常用但很有用的javascript方法</a></li>
<li><a href="http://blog.bestunix.net/2007/10/groovy-study-inf/" title="Groovy学习之资料篇">Groovy学习之资料篇</a></li>
<li><a href="http://blog.bestunix.net/2008/01/postgresql-performance-optimization-information/" title="PostgreSQL性能优化相关资料大全">PostgreSQL性能优化相关资料大全</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.bestunix.net/2007/11/javascript-and-xhtml-information/feed/</wfw:commentRss>
		</item>
		<item>
		<title>几个不常用但很有用的javascript方法</title>
		<link>http://blog.bestunix.net/2007/11/several-useful-but-not-commonly-used-method-of-javascript/</link>
		<comments>http://blog.bestunix.net/2007/11/several-useful-but-not-commonly-used-method-of-javascript/#comments</comments>
		<pubDate>Mon, 12 Nov 2007 14:03:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[心得]]></category>

		<category><![CDATA[javascript延时]]></category>

		<category><![CDATA[javascript技巧]]></category>

		<category><![CDATA[javascript日期间隔]]></category>

		<category><![CDATA[select设置默认值]]></category>

		<guid isPermaLink="false">http://sugg.spaces.live.com/Blog/cns!A712BCD987CCDA1B!225.entry</guid>
		<description><![CDATA[1. javascript代码延迟执行。
我们经常可以看到这样的应用，鼠标放到tab上时切换tab内容为当前tab.但是这...]]></description>
			<content:encoded><![CDATA[<h6>1. javascript代码延迟执行。</h6>
<p>我们经常可以看到这样的应用，鼠标放到tab上时切换tab内容为当前tab.但是这样就会有个问题，怎么样防止鼠标不经意划过tab时触发这个事件呢？可以通过延迟触发来避免这种情况,但是javascript中没有这样的函数。</p>
<p>javascript提供了一个函数 setTimeout(),可以延迟一个操作的执行，但是这个操作最终还是要执行的。我们需要的是鼠标放在tab上超过0.5s才执行某个操作，否则什么都不发生。</p>
<p>幸好，javascript还提供了另外一个函数，叫做clearTimeout(),于是这个问题就解决了。</p>

<div class="wp_syntax"><div class="code"><pre class="javascript"> <span style="color: #003366; font-weight: bold;">var</span> tabId<span style="color: #339933;">;</span>
 <span style="color: #003366; font-weight: bold;">var</span> timeoutId<span style="color: #339933;">;</span>
 <span style="color: #006600; font-style: italic;">//鼠标放上时</span>
 <span style="color: #003366; font-weight: bold;">function</span> tabOnMouseOver<span style="color: #009900;">&#40;</span>tabid<span style="color: #009900;">&#41;</span>
 <span style="color: #009900;">&#123;</span>
 tabId<span style="color: #339933;">=</span>tabid<span style="color: #339933;">;</span>
 <span style="color: #006600; font-style: italic;">//延时500毫秒</span>
 timeoutId<span style="color: #339933;">=</span>setTimeout<span style="color: #009900;">&#40;</span>changeTab<span style="color: #339933;">,</span><span style="color: #CC0000;">500</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
 <span style="color: #006600; font-style: italic;">//鼠标移开时清除定时器</span>
 <span style="color: #003366; font-weight: bold;">function</span> tabOnMouseOut<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
 <span style="color: #009900;">&#123;</span>
 clearTimeout<span style="color: #009900;">&#40;</span>timeoutId<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 tabId<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span></pre></div></div>

<h6>2. 设置下拉列表的默认值。</h6>
<p>通常的做法是用jsp标签在页面上判断当前默认应该选中哪个value.这样不但繁琐，程序的可读性也很差。这个工作完全交给javascript去做。</p>

<div class="wp_syntax"><div class="code"><pre class="javascript"><span style="color: #006600; font-style: italic;">// 设置下拉列表的默认值，用于设置表单初始值,表单加载结束时调用</span>
 <span style="color: #003366; font-weight: bold;">function</span> setSelectDefaultValue<span style="color: #009900;">&#40;</span>eleId<span style="color: #339933;">,</span>value<span style="color: #009900;">&#41;</span>
 <span style="color: #009900;">&#123;</span>
 <span style="color: #003366; font-weight: bold;">var</span> options<span style="color: #339933;">=</span>document.<span style="color: #006600;">getElementById</span><span style="color: #009900;">&#40;</span>eleId<span style="color: #009900;">&#41;</span>.<span style="color: #006600;">options</span><span style="color: #339933;">;</span>
 <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span>options.<span style="color: #006600;">length</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
 <span style="color: #009900;">&#123;</span>
 <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>options<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #006600;">value</span><span style="color: #339933;">==</span>value<span style="color: #009900;">&#41;</span>
 <span style="color: #009900;">&#123;</span>
 options<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #006600;">selected</span> <span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
 <span style="color: #009900;">&#125;</span>
 <span style="color: #009900;">&#125;</span></pre></div></div>

<p>这样，每次页面加载完之后调用这个方法set下拉列表的默认值就可以了。</p>
<h6>3. 计算两个日期间隔。</h6>
<p>这里要求日期的格式必须为&#8221;yyyy-MM-dd&#8221;格式。</p>

<div class="wp_syntax"><div class="code"><pre class="javascript"><span style="color: #006600; font-style: italic;">//检查日期间隔不能大于interval天</span>
 <span style="color: #003366; font-weight: bold;">function</span> checkInterval<span style="color: #009900;">&#40;</span>date1<span style="color: #339933;">,</span>date2<span style="color: #339933;">,</span>interval<span style="color: #009900;">&#41;</span>
 <span style="color: #009900;">&#123;</span>
 <span style="color: #006600; font-style: italic;">//将天数转为毫秒数</span>
 iseconds <span style="color: #339933;">=</span> <span style="color: #CC0000;">1000</span> <span style="color: #339933;">*</span> <span style="color: #CC0000;">3600</span> <span style="color: #339933;">*</span> <span style="color: #CC0000;">24</span> <span style="color: #339933;">*</span> interval<span style="color: #339933;">;</span>
 date1<span style="color: #339933;">=</span>Date.<span style="color: #006600;">parse</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> Date<span style="color: #009900;">&#40;</span>date1.<span style="color: #006600;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/-/g</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;/&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 date2<span style="color: #339933;">=</span>Date.<span style="color: #006600;">parse</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> Date<span style="color: #009900;">&#40;</span>date2.<span style="color: #006600;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/-/g</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;/&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>date2<span style="color: #339933;">-</span>date1<span style="color: #009900;">&#41;</span><span style="color: #339933;">&gt;</span>iseconds<span style="color: #009900;">&#41;</span>
 <span style="color: #009900;">&#123;</span>
 <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;查询时间间隔不能超过&quot;</span> <span style="color: #339933;">+</span> interval <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;天&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">;</span>
 <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
 <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>date2<span style="color: #339933;">-</span>date1<span style="color: #009900;">&#41;</span><span style="color: #339933;">&lt;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span>
 <span style="color: #009900;">&#123;</span>
 <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;请设置正确的查询间隔，开始时间不能晚于结束时间&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
 <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">true</span>
 <span style="color: #009900;">&#125;</span></pre></div></div>

<p>&copy;2008 <a href="http://blog.bestunix.net">苏小勇的blog</a>. All Rights Reserved.</p>.<b>相关文章：</b><br>
<ul><li><a href="http://blog.bestunix.net/2007/10/several-useful-articles/" title="几篇有用的文章">几篇有用的文章</a></li>
<li><a href="http://blog.bestunix.net/2007/11/javascript-and-xhtml-information/" title="关于javascript和xhtml的资料">关于javascript和xhtml的资料</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.bestunix.net/2007/11/several-useful-but-not-commonly-used-method-of-javascript/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Groovy WebSite Generator(Groovy 网站生成器)开源啦</title>
		<link>http://blog.bestunix.net/2007/11/groovy-website-generator-groovy-site-generator-open-source%c0%b2/</link>
		<comments>http://blog.bestunix.net/2007/11/groovy-website-generator-groovy-site-generator-open-source%c0%b2/#comments</comments>
		<pubDate>Sun, 11 Nov 2007 13:47:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[心得]]></category>

		<category><![CDATA[Groovy]]></category>

		<category><![CDATA[gwg]]></category>

		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://sugg.spaces.live.com/Blog/cns!A712BCD987CCDA1B!224.entry</guid>
		<description><![CDATA[
用于生成bestunix 的程序发布在google code上，网址为 http://gwg.googlecode.com .
可以通过 svn checkout http://gwg.googlecode.com/svn/trunk/ gwg 取得最新代码。也可以在网站上下载打包好的代码。
经过两次比较大的重构(更新历史)，目前gwg的主要功能有：

使用groovy根据rss生成网站首页，detail页面，分类页面，tag页面；
使用google ajax api实现了站内搜索功能；
页面内容中的tag链接替换为本地链接；
实现了本地rss输出；
实现了google sitemap；

gwg的价值在哪里：

可以快速的生成自己的独立网站；
只有一个配置文件需要修改；
网页风格可以通过dreamweaver的模板快速更改；
gwg本身也是很好的groovy资料

快速启动：

首先需要配置好groovy运行环境；
进入gwg/src 目录，修改Config中的sourcePath和topFolder路径
在命令行运行 groovy start.groovy


&#169;2008 苏小勇的blog. All Rights Reserved..相关文章：
使用Groovy自动生成网站
Groovy学习之资料篇
一些大型网站的架构信息
PostgreSQL性能优化相关资料大全
关于javascript和xhtml的资料]]></description>
			<content:encoded><![CDATA[<div style="padding-right:0px;display:inline;padding-left:0px;padding-bottom:0px;margin:0px;padding-top:0px"><a rel="tag" href="http://technorati.com/tags/open source/"></a></div>
<p>用于生成<a href="http://www.bestunix.net" target="_blank">bestunix</a> 的程序发布在google code上，网址为 <a href="http://gwg.googlecode.com" target="_blank">http://gwg.googlecode.com</a> .</p>
<p>可以通过 <tt>svn checkout <strong><em>http</em></strong>://gwg.googlecode.com/svn/trunk/ gwg 取得最新代码。也可以在网站上下载打包好的代码。</tt></p>
<p><tt>经过两次比较大的重构(<a href="http://www.bestunix.net/archive/2007/10/21/203.html" target="_blank">更新历史</a>)，目前gwg的主要功能有：</tt></p>
<ol>
<li><tt>使用groovy根据rss生成网站首页，detail页面，分类页面，tag页面；</tt></li>
<li><tt>使用google ajax api实现了站内搜索功能；</tt></li>
<li><tt>页面内容中的tag链接替换为本地链接；</tt></li>
<li><tt>实现了本地rss输出；</tt></li>
<li><tt>实现了google sitemap；</tt></li>
</ol>
<p><tt>gwg的价值在哪里：</tt></p>
<ol>
<li><tt>可以快速的生成自己的独立网站；</tt></li>
<li><tt>只有一个配置文件需要修改；</tt></li>
<li><tt>网页风格可以通过dreamweaver的模板快速更改；</tt></li>
<li><tt>gwg本身也是很好的groovy资料</tt></li>
</ol>
<p><tt>快速启动：</tt></p>
<ol>
<li>首先需要配置好groovy运行环境；</li>
<li>进入gwg/src 目录，修改Config中的sourcePath和topFolder路径</li>
<li>在命令行运行 groovy start.groovy</li>
</ol>
<p><img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-6407851677322520037&amp;page=RSS%ef%bc%9aGroovy+WebSite+Generator(Groovy+%e7%bd%91%e7%ab%99%e7%94%9f%e6%88%90%e5%99%a8)%e5%bc%80%e6%ba%90%e5%95%a6&amp;referrer=" border="0" alt="" width="1" height="1" /><img style="position:absolute" src="http://c.live.com/c.gif?NC=31263&amp;NA=1149&amp;PI=81873&amp;RF=&amp;DI=3919&amp;PS=85545&amp;TP=sugg.spaces.live.com&amp;GT1=sugg" alt="" width="0" height="0" /></p>
<p>&copy;2008 <a href="http://blog.bestunix.net">苏小勇的blog</a>. All Rights Reserved.</p>.<b>相关文章：</b><br>
<ul><li><a href="http://blog.bestunix.net/2007/10/groovy-automatically-generated-website/" title="使用Groovy自动生成网站">使用Groovy自动生成网站</a></li>
<li><a href="http://blog.bestunix.net/2007/10/groovy-study-inf/" title="Groovy学习之资料篇">Groovy学习之资料篇</a></li>
<li><a href="http://blog.bestunix.net/2007/10/some-large-scale-structure-of-the-web-site-information/" title="一些大型网站的架构信息">一些大型网站的架构信息</a></li>
<li><a href="http://blog.bestunix.net/2008/01/postgresql-performance-optimization-information/" title="PostgreSQL性能优化相关资料大全">PostgreSQL性能优化相关资料大全</a></li>
<li><a href="http://blog.bestunix.net/2007/11/javascript-and-xhtml-information/" title="关于javascript和xhtml的资料">关于javascript和xhtml的资料</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.bestunix.net/2007/11/groovy-website-generator-groovy-site-generator-open-source%c0%b2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>sequoia中的日志</title>
		<link>http://blog.bestunix.net/2007/11/sequoia-log/</link>
		<comments>http://blog.bestunix.net/2007/11/sequoia-log/#comments</comments>
		<pubDate>Fri, 09 Nov 2007 17:15:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[方案]]></category>

		<category><![CDATA[sequoia]]></category>

		<category><![CDATA[数据库负载均衡]]></category>

		<category><![CDATA[数据库集群]]></category>

		<category><![CDATA[数据库高可用]]></category>

		<category><![CDATA[负载均衡]]></category>

		<category><![CDATA[集群]]></category>

		<category><![CDATA[高可用]]></category>

		<guid isPermaLink="false">http://sugg.spaces.live.com/Blog/cns!A712BCD987CCDA1B!223.entry</guid>
		<description><![CDATA[Sequoia 提供了基于log4j的日志服务。
它的日志系统允许你选择，比如：

哪个组件要记录日志
要创建哪些日志文件。
不同的日志级别决定日志记录的详细程度
不同的appender决定日志的输出形式。默认地，Sequoia 日志保存在日志文件里，同时提供屏幕输出。你可以选择其他的appender,比如发送日志到一个远程的日志服务器或者email.


你安装完之后，在Sequoia的安装目录会有一个名为log4j.properties 的配置文件。你可以在运行时通过修改这个配置文件来控制日志输出。
日志级别
你可以为每个组件指定具体的日志级别。如果日志级别为OFF ,那么这个Sequoia 组件的日志就被关掉了。
下面是5种可用的日志级别:

DEBUG
INFO
WARN
ERROR
FATAL .

日志级别决定了记录事件的严重性级别。比如，如果日志级别为ERROR,那么只有ERROR 或 FATAL级别的事件才会被记录。
&#169;2008 苏小勇的blog. All Rights Reserved..相关文章：
sequoia负载均衡
sequoia中添加和同步集群节点
sequoia简介
sequoia的架构
sequoia部署模型
sequoia中的自动故障处理
集群中几种session同步解决方案的比较
几个linux集群节点的辅助管理工具]]></description>
			<content:encoded><![CDATA[<p>Sequoia 提供了基于log4j的日志服务。</p>
<p>它的日志系统允许你选择，比如：</p>
<ul>
<li><a></a>哪个组件要记录日志</li>
<li><a></a>要创建哪些日志文件。</li>
<li>不同的日志级别决定日志记录的详细程度<a></a></li>
<li>不同的appender决定日志的输出形式。默认地，Sequoia 日志保存在日志文件里，同时提供屏幕输出。你可以选择其他的appender,比如发送日志到一个远程的日志服务器或者email.</li>
</ul>
<p><a></a></p>
<p>你安装完之后，在Sequoia的安装目录会有一个名为<code>log4j.properties</code> 的配置文件。你可以在运行时通过修改这个配置文件来控制日志输出。</p>
<h3><a></a><a></a>日志级别</h3>
<p>你可以为每个组件指定具体的日志级别。如果日志级别为<code>OFF</code> ,那么这个Sequoia 组件的日志就被关掉了。</p>
<p><a></a>下面是5种可用的日志级别:</p>
<ul>
<li><a></a><code>DEBUG</code></li>
<li><a></a><code>INFO</code></li>
<li><a></a><code>WARN</code></li>
<li><a></a><code>ERROR</code></li>
<li><a></a><code>FATAL</code> .</li>
</ul>
<p>日志级别决定了记录事件的严重性级别。比如，如果日志级别为ERROR,那么只有<code>ERROR</code> 或 <code>FATAL级别的事件才会被记录。</code><img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-6407851677322520037&amp;page=RSS%ef%bc%9asequoia%e4%b8%ad%e7%9a%84%e6%97%a5%e5%bf%97&amp;referrer=" border="0" alt="" width="1" height="1" /><img style="position:absolute" src="http://c.live.com/c.gif?NC=31263&amp;NA=1149&amp;PI=81873&amp;RF=&amp;DI=3919&amp;PS=85545&amp;TP=sugg.spaces.live.com&amp;GT1=sugg" alt="" width="0" height="0" /></p>
<p>&copy;2008 <a href="http://blog.bestunix.net">苏小勇的blog</a>. All Rights Reserved.</p>.<b>相关文章：</b><br>
<ul><li><a href="http://blog.bestunix.net/2007/11/sequoia-load-balancing/" title="sequoia负载均衡">sequoia负载均衡</a></li>
<li><a href="http://blog.bestunix.net/2007/11/sequoia-add-an-synchronized-cluster-node/" title="sequoia中添加和同步集群节点">sequoia中添加和同步集群节点</a></li>
<li><a href="http://blog.bestunix.net/2007/10/sequoia-summary/" title="sequoia简介">sequoia简介</a></li>
<li><a href="http://blog.bestunix.net/2007/11/sequoia-architecture/" title="sequoia的架构">sequoia的架构</a></li>
<li><a href="http://blog.bestunix.net/2007/11/sequoia-deployment-model/" title="sequoia部署模型">sequoia部署模型</a></li>
<li><a href="http://blog.bestunix.net/2007/11/sequoia%e4%b8%ad%e7%9a%84%e8%87%aa%e5%8a%a8%e6%95%85%e9%9a%9c%e5%a4%84%e7%90%86/" title="sequoia中的自动故障处理">sequoia中的自动故障处理</a></li>
<li><a href="http://blog.bestunix.net/2007/10/several-clusters-in-the-session-synchronization-solutions-compared/" title="集群中几种session同步解决方案的比较">集群中几种session同步解决方案的比较</a></li>
<li><a href="http://blog.bestunix.net/2008/08/linux-cluster-node-administrative-tools/" title="几个linux集群节点的辅助管理工具">几个linux集群节点的辅助管理工具</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.bestunix.net/2007/11/sequoia-log/feed/</wfw:commentRss>
		</item>
		<item>
		<title>sequoia中的自动故障处理</title>
		<link>http://blog.bestunix.net/2007/11/sequoia%e4%b8%ad%e7%9a%84%e8%87%aa%e5%8a%a8%e6%95%85%e9%9a%9c%e5%a4%84%e7%90%86/</link>
		<comments>http://blog.bestunix.net/2007/11/sequoia%e4%b8%ad%e7%9a%84%e8%87%aa%e5%8a%a8%e6%95%85%e9%9a%9c%e5%a4%84%e7%90%86/#comments</comments>
		<pubDate>Fri, 09 Nov 2007 17:14:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[方案]]></category>

		<category><![CDATA[sequoia]]></category>

		<category><![CDATA[数据库负载均衡]]></category>

		<category><![CDATA[数据库集群]]></category>

		<category><![CDATA[数据库高可用]]></category>

		<category><![CDATA[负载均衡]]></category>

		<category><![CDATA[集群]]></category>

		<category><![CDATA[高可用]]></category>

		<guid isPermaLink="false">http://sugg.spaces.live.com/Blog/cns!A712BCD987CCDA1B!222.entry</guid>
		<description><![CDATA[Sequoia 提供了完全透明的故障处理。这意味着只要保证至少有一个后端处于enable状态，客户端应用就感觉不到故障的发生。因此，客户端不需要针对集群的异常做任何处理。
下面将更详细地说明不同情况的故障处理：
处理控制器连接失败
如果一个控制器实例连接失败，Sequoia 连接器会根据预定义的规则透明地将客户端连接重新连接到另一个控制器。参考在控制器之间分配客户端连接。
如果是在一个事务内部发生故障，事务的上下文会在重新连接时自动保存。
处理控制器失败
如果一个控制器失败，这个控制器上的后端会被disable掉。现有的客户端连接也会自动的根据预定义的规则重新连接到另外一个控制器上。
正在执行的查询，按下面方法处理:

如果控制器在读写查询执行之前失败，那么这些读写查询会被自动恢复重新执行（甚至在事务内部也可以） 。
如果查询已经执行了但是尚未返回结果，这个时候控制器失败了，那么结果仍然可以得到。

当控制器无法从错误中恢复时，Sequoia 会在log目录自动生成一个名为sequoia.report的trace文件.
处理后端错误
如果后端失败了，它会从负载均衡器上自动去掉。失败操作的处理则取决于查询类型：

如果在读操作时后端失败，这个操作会在另外一个后端上重试。如果重试成功了，第一个后端会被disabled掉。如果在所有的后端上都失败了，那么这个查询可能有问题。.
如果在写操作的过程中后端失败，但是这个写操作在其他后端上执行成功，那么这个失败会被忽略。

这样，所有的失败都可以对客户端透明地处理。
&#169;2008 苏小勇的blog. All Rights Reserved..相关文章：
sequoia负载均衡
sequoia中添加和同步集群节点
sequoia简介
sequoia中的日志
sequoia的架构
sequoia部署模型
使用Groovy自动生成网站
几个linux集群节点的辅助管理工具
集群中几种session同步解决方案的比较]]></description>
			<content:encoded><![CDATA[<p>Sequoia 提供了完全透明的故障处理。这意味着只要保证至少有一个后端处于enable状态，客户端应用就感觉不到故障的发生。因此，客户端不需要针对集群的异常做任何处理。</p>
<p>下面将更详细地说明不同情况的故障处理：</p>
<h6>处理控制器连接失败</h6>
<p>如果一个控制器实例连接失败，Sequoia 连接器会根据预定义的规则透明地将客户端连接重新连接到另一个控制器。参考在控制器之间分配客户端连接。</p>
<p>如果是在一个事务内部发生故障，事务的上下文会在重新连接时自动保存。</p>
<h6>处理控制器失败</h6>
<p>如果一个控制器失败，这个控制器上的后端会被disable掉。现有的客户端连接也会自动的根据预定义的规则重新连接到另外一个控制器上。</p>
<p><a></a>正在执行的查询，按下面方法处理:</p>
<ul>
<li>如果控制器在读写查询执行之前失败，那么这些读写查询会被自动恢复重新执行（甚至在事务内部也可以） 。</li>
<li><a></a>如果查询已经执行了但是尚未返回结果，这个时候控制器失败了，那么结果仍然可以得到。</li>
</ul>
<p>当控制器无法从错误中恢复时，Sequoia 会在log目录自动生成一个名为<code>sequoia.report的</code>trace文件.</p>
<h6>处理后端错误</h6>
<p><a></a>如果后端失败了，它会从负载均衡器上自动去掉。失败操作的处理则取决于查询类型：</p>
<ul>
<li><a></a>如果在读操作时后端失败，这个操作会在另外一个后端上重试。如果重试成功了，第一个后端会被disabled掉。如果在所有的后端上都失败了，那么这个查询可能有问题。.</li>
<li><a></a>如果在写操作的过程中后端失败，但是这个写操作在其他后端上执行成功，那么这个失败会被忽略。</li>
</ul>
<p>这样，所有的失败都可以对客户端透明地处理。<img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-6407851677322520037&amp;page=RSS%ef%bc%9asequoia%e4%b8%ad%e7%9a%84%e8%87%aa%e5%8a%a8%e6%95%85%e9%9a%9c%e5%a4%84%e7%90%86&amp;referrer=" border="0" alt="" width="1" height="1" /><img style="position:absolute" src="http://c.live.com/c.gif?NC=31263&amp;NA=1149&amp;PI=81873&amp;RF=&amp;DI=3919&amp;PS=85545&amp;TP=sugg.spaces.live.com&amp;GT1=sugg" alt="" width="0" height="0" /></p>
<p>&copy;2008 <a href="http://blog.bestunix.net">苏小勇的blog</a>. All Rights Reserved.</p>.<b>相关文章：</b><br>
<ul><li><a href="http://blog.bestunix.net/2007/11/sequoia-load-balancing/" title="sequoia负载均衡">sequoia负载均衡</a></li>
<li><a href="http://blog.bestunix.net/2007/11/sequoia-add-an-synchronized-cluster-node/" title="sequoia中添加和同步集群节点">sequoia中添加和同步集群节点</a></li>
<li><a href="http://blog.bestunix.net/2007/10/sequoia-summary/" title="sequoia简介">sequoia简介</a></li>
<li><a href="http://blog.bestunix.net/2007/11/sequoia-log/" title="sequoia中的日志">sequoia中的日志</a></li>
<li><a href="http://blog.bestunix.net/2007/11/sequoia-architecture/" title="sequoia的架构">sequoia的架构</a></li>
<li><a href="http://blog.bestunix.net/2007/11/sequoia-deployment-model/" title="sequoia部署模型">sequoia部署模型</a></li>
<li><a href="http://blog.bestunix.net/2007/10/groovy-automatically-generated-website/" title="使用Groovy自动生成网站">使用Groovy自动生成网站</a></li>
<li><a href="http://blog.bestunix.net/2008/08/linux-cluster-node-administrative-tools/" title="几个linux集群节点的辅助管理工具">几个linux集群节点的辅助管理工具</a></li>
<li><a href="http://blog.bestunix.net/2007/10/several-clusters-in-the-session-synchronization-solutions-compared/" title="集群中几种session同步解决方案的比较">集群中几种session同步解决方案的比较</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.bestunix.net/2007/11/sequoia%e4%b8%ad%e7%9a%84%e8%87%aa%e5%8a%a8%e6%95%85%e9%9a%9c%e5%a4%84%e7%90%86/feed/</wfw:commentRss>
		</item>
		<item>
		<title>sequoia中添加和同步集群节点</title>
		<link>http://blog.bestunix.net/2007/11/sequoia-add-an-synchronized-cluster-node/</link>
		<comments>http://blog.bestunix.net/2007/11/sequoia-add-an-synchronized-cluster-node/#comments</comments>
		<pubDate>Fri, 09 Nov 2007 17:13:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[方案]]></category>

		<category><![CDATA[sequoia]]></category>

		<category><![CDATA[数据库负载均衡]]></category>

		<category><![CDATA[数据库集群]]></category>

		<category><![CDATA[数据库高可用]]></category>

		<category><![CDATA[负载均衡]]></category>

		<category><![CDATA[集群]]></category>

		<category><![CDATA[高可用]]></category>

		<guid isPermaLink="false">http://sugg.spaces.live.com/Blog/cns!A712BCD987CCDA1B!221.entry</guid>
		<description><![CDATA[
当一个新的后端添加到集群中时，它下面的数据库必须被初始化为跟其他活动节点下的数据库相同的状态。
在Sequoia中，当一个新的节点添加到集群中时，会用recovery log这个节点初始化为跟集群中其他节点相同的状态。这个进程不会影响到集群的其他操作，这使得Sequoia可以不停机的进行故障恢复。
Sequoia 的控制器为每个虚拟数据库保留一份recovery log,这个log记录了所有更新过虚拟数据库的查询和事务。recovery log包含下面内容：:

指向数据库dump的元数据，这个dump是某个时间点的数据库状态的快照 (这个数据库快照存放在文件系统中。)
数据库dump创建以后，所有的更新过数据库的查询和数据库的记录。

disable掉的节点自动记录recovery log
当你disable掉一个后端，比如，执行数据库维护，Sequoia 将会:

自动在recovery log中插入一个checkpoint来记录它下面数据库的状态。
继续记录来自客户端的请求.

当你重新enable这个后端时，系统将会播放recovery log中从指定checkpoint以后的所有来自客户端的update请求，同步它下面的数据库。
从数据库dump中恢复数据库
如果你在正在使用的集群中添加一个新的后端，或者恢复一个失败的后端，你必须先考虑一下有没有可以用来自动同步数据的数据库快照。因此，数据库并不是简单地只用recovery log就可以同步的。
在这种情况下，你必须先从一个有效的数据库dump中恢复数据库。从有效的dump文件中恢复数据库也为你想用的后端增加了一个干净的checkpoint.
注意：
你应该定期备份你的数据库，以获得一个有效的数据库dump.
数据库备份
使用备份管理器，你可以备份一个数据库来创建一个dump;或者一个表结构和特定数据库的数据作为一个dump。你可以使用这个dump来：

为你准备添加到集群中的后端来恢复数据, 或者
恢复失败的后端.

备份操作的过程是这样的:

如果后端处于enable状态，那么在备份时它将会被disable掉。它下面的数据库会继续运行。
在数据库备份过程中，来自客户端的请求将被记录到 recovery log.
如果一个正在备份的后端被切换到enable状态，它会在备份结束后自动使用recovery log同步数据库,然后enable它自己。

警告
如果只有一个enable的后端可用，你对它执行备份操作会导致它转入disable状态。因此，整个集群在备份期间将停止服务。
你应该定时进行数据库备份以避免需要停止整个集群来备份的情况发生。
 
&#169;2008 苏小勇的blog. All Rights Reserved..相关文章：
几个linux集群节点的辅助管理工具
sequoia负载均衡
集群中几种session同步解决方案的比较
sequoia简介
sequoia部署模型
sequoia中的自动故障处理
sequoia中的日志
sequoia的架构]]></description>
			<content:encoded><![CDATA[<div style="padding-right:0px;display:inline;padding-left:0px;padding-bottom:0px;margin:0px;padding-top:0px"><a rel="tag" href="http://technorati.com/tags/%e6%95%b0%e6%8d%ae%e5%ba%93%e9%ab%98%e5%8f%af%e7%94%a8/"></a></div>
<p>当一个新的后端添加到集群中时，它下面的数据库必须被初始化为跟其他活动节点下的数据库相同的状态。</p>
<p>在Sequoia中，当一个新的节点添加到集群中时，会用recovery log这个节点初始化为跟集群中其他节点相同的状态。这个进程不会影响到集群的其他操作，这使得Sequoia可以不停机的进行故障恢复。</p>
<p><a></a>Sequoia 的控制器为每个虚拟数据库保留一份recovery log,这个log记录了所有更新过虚拟数据库的查询和事务。recovery log包含下面内容：:</p>
<ul>
<li>指向数据库dump的元数据，这个dump是某个时间点的数据库状态的快照 (这个数据库快照存放在文件系统中。)</li>
<li>数据库dump创建以后，所有的更新过数据库的查询和数据库的记录。</li>
</ul>
<h6>disable掉的节点自动记录recovery log</h6>
<p><a></a>当你disable掉一个后端，比如，执行数据库维护，Sequoia 将会:</p>
<ol>
<li><a></a>自动在recovery log中插入一个checkpoint来记录它下面数据库的状态。</li>
<li><a></a>继续记录来自客户端的请求.</li>
</ol>
<p>当你重新enable这个后端时，系统将会播放recovery log中从指定checkpoint以后的所有来自客户端的update请求，同步它下面的数据库。</p>
<h6>从数据库dump中恢复数据库</h6>
<p>如果你在正在使用的集群中添加一个新的后端，或者恢复一个失败的后端，你必须先考虑一下有没有可以用来自动同步数据的数据库快照。因此，数据库并不是简单地只用recovery log就可以同步的。</p>
<p>在这种情况下，你必须先从一个有效的数据库dump中恢复数据库。从有效的dump文件中恢复数据库也为你想用的后端增加了一个干净的checkpoint.</p>
<h6>注意：</h6>
<p>你应该定期备份你的数据库，以获得一个有效的数据库dump.</p>
<h6>数据库备份</h6>
<p><a></a>使用备份管理器，你可以备份一个数据库来创建一个dump;或者一个表结构和特定数据库的数据作为一个dump。你可以使用这个dump来：</p>
<ul>
<li>为你准备添加到集群中的后端来恢复数据, 或者</li>
<li><a></a>恢复失败的后端.</li>
</ul>
<p>备份操作的过程是这样的:</p>
<ol>
<li><a></a>如果后端处于enable状态，那么在备份时它将会被disable掉。它下面的数据库会继续运行。</li>
<li><a></a>在数据库备份过程中，来自客户端的请求将被记录到 recovery log.</li>
<li><a></a>如果一个正在备份的后端被切换到enable状态，它会在备份结束后自动使用recovery log同步数据库,然后enable它自己。</li>
</ol>
<h6><strong>警告</strong></h6>
<p><em>如果只有一个enable的后端可用，你对它执行备份操作会导致它转入disable状态。因此，整个集群在备份期间将停止服务。</em></p>
<p><em>你应该定时进行数据库备份以避免需要停止整个集群来备份的情况发生。</em></p>
<p><a> </a><img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-6407851677322520037&amp;page=RSS%ef%bc%9asequoia%e4%b8%ad%e6%b7%bb%e5%8a%a0%e5%92%8c%e5%90%8c%e6%ad%a5%e9%9b%86%e7%be%a4%e8%8a%82%e7%82%b9&amp;referrer=" border="0" alt="" width="1" height="1" /><img style="position:absolute" src="http://c.live.com/c.gif?NC=31263&amp;NA=1149&amp;PI=81873&amp;RF=&amp;DI=3919&amp;PS=85545&amp;TP=sugg.spaces.live.com&amp;GT1=sugg" alt="" width="0" height="0" /></p>
<p>&copy;2008 <a href="http://blog.bestunix.net">苏小勇的blog</a>. All Rights Reserved.</p>.<b>相关文章：</b><br>
<ul><li><a href="http://blog.bestunix.net/2008/08/linux-cluster-node-administrative-tools/" title="几个linux集群节点的辅助管理工具">几个linux集群节点的辅助管理工具</a></li>
<li><a href="http://blog.bestunix.net/2007/11/sequoia-load-balancing/" title="sequoia负载均衡">sequoia负载均衡</a></li>
<li><a href="http://blog.bestunix.net/2007/10/several-clusters-in-the-session-synchronization-solutions-compared/" title="集群中几种session同步解决方案的比较">集群中几种session同步解决方案的比较</a></li>
<li><a href="http://blog.bestunix.net/2007/10/sequoia-summary/" title="sequoia简介">sequoia简介</a></li>
<li><a href="http://blog.bestunix.net/2007/11/sequoia-deployment-model/" title="sequoia部署模型">sequoia部署模型</a></li>
<li><a href="http://blog.bestunix.net/2007/11/sequoia%e4%b8%ad%e7%9a%84%e8%87%aa%e5%8a%a8%e6%95%85%e9%9a%9c%e5%a4%84%e7%90%86/" title="sequoia中的自动故障处理">sequoia中的自动故障处理</a></li>
<li><a href="http://blog.bestunix.net/2007/11/sequoia-log/" title="sequoia中的日志">sequoia中的日志</a></li>
<li><a href="http://blog.bestunix.net/2007/11/sequoia-architecture/" title="sequoia的架构">sequoia的架构</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.bestunix.net/2007/11/sequoia-add-an-synchronized-cluster-node/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
