<?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>Life Style! &#187; 系统管理</title>
	<atom:link href="http://www.realqi.cn/category/%e7%b3%bb%e7%bb%9f%e7%ae%a1%e7%90%86/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.realqi.cn</link>
	<description>系统管理  维护监控  简单生活</description>
	<lastBuildDate>Wed, 25 Aug 2010 14:41:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Apache Don&#039;t Log Specific IP Address and User-Agents</title>
		<link>http://www.realqi.cn/2009/10/apache-dont-log-specific-ip-address-and-user-agents/</link>
		<comments>http://www.realqi.cn/2009/10/apache-dont-log-specific-ip-address-and-user-agents/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 06:52:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[技术实践]]></category>
		<category><![CDATA[系统管理]]></category>
		<category><![CDATA[经验技巧]]></category>
		<category><![CDATA[Don't Log]]></category>
		<category><![CDATA[setenvif]]></category>

		<guid isPermaLink="false">http://realqi.cn/?p=508</guid>
		<description><![CDATA[  自cacti 开启通过mod_staus对apache 的监控后,apache多了很多监控的访问日志, 对手动分析apache日志,或用awstats分析日志时都需要先对日志进行过滤,一是对监控固定的ip进行日志址滤掉,二是监控访问的固定URL,(awstats也可以过滤掉)先是cat.再grep 然后又是sed ,费时,日志大了还很耗资源. 

     以关键词"dontlog special ip apache" 找到"setenvif"指令
]]></description>
			<content:encoded><![CDATA[<p>      自cacti 开启通过mod_status对apache 的监控后,apache多了很多监控的访问日志, 对手动分析apache日志,或用awstats分析日志时都需要先对日志进行过滤,一是对监控固定的ip进行日志址滤掉,二是监控访问的固定URL,(awstats也可以过滤掉)先是cat.再grep 然后又是sed ,费时,日志大了还很耗资源.</p>
<p>     以关键词"dontlog special ip apache" 找到"setenvif"指令  apache果然可以对特定的url 和或访问IP 不进行日志记录, 详细了解请看:<a href="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/mod/mod_setenvif.html ">apache 中文手册</a> (<a href="http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/mod/mod_setenvif.html ">chinaunix</a>)</p>
<p><strong>实现</strong><br />
         apache需要装载mod_setenvif模块,可用<span style="color: #ff0000;">apachectl -M</span> 命令确认apache是否已装载此模块.如果没有则需要手动编绎一下.可用下面的指令来进行编绎</p>
<pre>         cd   apache_source/modules/metadata
         /usr/local/apache2/bin/apxs -a -i -c mod_setenvif.c</pre>
<p>如下:apachectl -M 已看到apache已成功装载 <span style="color: #ff0000;">mod_setenvif</span></p>
<blockquote><p>userdir_module (static)<br />
 alias_module (static)<br />
 so_module (static)<br />
setenvif_module (shared)</p></blockquote>
<p>打开httpd.conf 文件在合适的位置添加如下内容,</p>
<pre>   #SetEnvIf Remote_Addr "10\.11\.10\.254" dontlog
   SetEnvIf Remote_Addr "::1" dontlog
   SetEnvIf Request_URI "server-status" dontlog</pre>
<p>然后修改CustomLog "logs/access_log" combined 为</p>
<blockquote><p>CustomLog "logs/access_log" combined env=!dontlog</p></blockquote>
<p>重启apache</p>
<p>可以用tail -f ../logs/access_log 已看不到监控访问的日志了<br />
<h3>相关文章</h3>
<ul class="related_post">
<li>2009年10月15日 -- <a href="http://www.realqi.cn/2009/10/apache%e9%85%8d%e7%bd%ae%e8%99%9a%e6%8b%9f%e4%b8%bb%e6%9c%ba%e7%9a%84%e4%b8%89%e7%a7%8d%e6%96%b9%e6%b3%95/" title="APACHE配置虚拟主机的三种方法">APACHE配置虚拟主机的三种方法 (0)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.realqi.cn/2009/10/apache-dont-log-specific-ip-address-and-user-agents/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>APACHE配置虚拟主机的三种方法</title>
		<link>http://www.realqi.cn/2009/10/apache%e9%85%8d%e7%bd%ae%e8%99%9a%e6%8b%9f%e4%b8%bb%e6%9c%ba%e7%9a%84%e4%b8%89%e7%a7%8d%e6%96%b9%e6%b3%95/</link>
		<comments>http://www.realqi.cn/2009/10/apache%e9%85%8d%e7%bd%ae%e8%99%9a%e6%8b%9f%e4%b8%bb%e6%9c%ba%e7%9a%84%e4%b8%89%e7%a7%8d%e6%96%b9%e6%b3%95/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 05:54:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[系统管理]]></category>
		<category><![CDATA[运维监控]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[lamp]]></category>
		<category><![CDATA[vhosts]]></category>

		<guid isPermaLink="false">http://realqi.cn/?p=456</guid>
		<description><![CDATA[    apache有三种配置虚拟主机的方法，分别是基于不同的端口，不同的IP，和基于不同的域名，这三种方法分别适合不同的场景，

     apache2.2以上建义虚拟主机的配置或是修改都在conf/extra/httpd-vhost.conf 文件里进行。然后去掉httpd.conf 里面的 #Include  conf/extra/httpd-vhosts.conf 这一行的注释("#" )
]]></description>
			<content:encoded><![CDATA[<p><strong>lamp的安装参考: <a href="http://realqi.cn/2009/09/%e5%ae%89%e8%a3%85lamp%e7%8e%af%e5%a2%83%e6%a0%87%e5%87%86%e7%89%88/">安装lamp</a></strong></p>
<p>    apache有三种配置虚拟主机的方法，分别是基于不同的端口，不同的IP，和基于不同的域名，这三种方法分别适合不同的场景，</p>
<p>     apache2.2以上建义虚拟主机的配置或是修改都在<strong>conf/extra/httpd-vhost.conf </strong>文件里进行。然后去掉httpd.conf 里面的 <strong>#Include </strong> <strong>conf/extra/httpd-vhosts.conf</strong> 这一行的注释("#" )</p>
<p>    针对apache配置文件的修改,都需要重启apache服务</p>
<p><strong>1.基于相同IP不同Port的虚拟主机</strong><br />
    更改虚拟主机配置,例如下:</p>
<pre>    Listen 80
    Listen 8888
&lt;VirtualHost *:80&gt;
    ServerAdmin <a href="mailto:cacti@realqi.cn">cacti@realqi.cn</a>
    DocumentRoot "/usr/local/apache2/htdocs/wordpress/"
    ServerName  develop.realqi.cn
    DirectoryIndex index.php
&lt;/VirtualHost&gt;
 
&lt;VirtualHost *:8888&gt;
    ServerAdmin <a href="mailto:cacti@realqi.cn">cacti@realqi.cn</a>
    DocumentRoot "/usr/local/apache2/htdocs/cms/wordpress"
    ServerName  cms.realqi.cn
&lt;/VirtualHost&gt;</pre>
<p>注意:相关的目录如"wordpress","../cms/wordpress" 必需存在.重启apache,就可生效.</p>
<p align="left"><strong>2.</strong><strong>基于相同</strong><strong>Port</strong><strong>不同</strong><strong>IP</strong><strong>的虚拟主机这种情况适合服务器有多个IP</strong></p>
<p align="left"><strong>      详细参考：</strong></p>
<p align="left"><strong>3.</strong><strong>基于域名的虚拟主机的访问，例子如下</strong></p>
<pre>NameVirtualHost 10.29.20.22 

&lt;VirtualHost <a href="http://www.realqi.cn">www.realqi.cn</a>&gt;
    ServerAdmin <a href="mailto:cacti@realqi.cn">cacti@realqi.cn</a>
    DocumentRoot "/usr/local/apache2/htdocs/"
    ServerName  <a href="http://www.realqi.cn">www.realqi.cn</a>
    DirectoryIndex rd.html
&lt;/VirtualHost&gt;
 
&lt;VirtualHost develop.realqi.cn&gt;
    ServerAdmin <a href="mailto:cacti@realqi.cn">cacti@realqi.cn</a>
    DocumentRoot "/usr/local/apache2/htdocs/wordpress/"
    ServerName  develop.realqi.cn
    DirectoryIndex index.php
&lt;/VirtualHost&gt;</pre>
<h3>相关文章</h3>
<ul class="related_post">
<li>2009年10月21日 -- <a href="http://www.realqi.cn/2009/10/apache-dont-log-specific-ip-address-and-user-agents/" title="Apache Don&#8217;t Log Specific IP Address and User-Agents">Apache Don&#8217;t Log Specific IP Address and User-Agents (3)</a></li>
<li>2009年09月21日 -- <a href="http://www.realqi.cn/2009/09/%e5%ae%89%e8%a3%85lamp%e7%8e%af%e5%a2%83%e6%a0%87%e5%87%86%e7%89%88/" title="安装LAMP环境(未完成版)">安装LAMP环境(未完成版) (5)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.realqi.cn/2009/10/apache%e9%85%8d%e7%bd%ae%e8%99%9a%e6%8b%9f%e4%b8%bb%e6%9c%ba%e7%9a%84%e4%b8%89%e7%a7%8d%e6%96%b9%e6%b3%95/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>linux性能相关指标[监控基础知识一]</title>
		<link>http://www.realqi.cn/2009/10/linux%e6%80%a7%e8%83%bd%e5%86%85%e5%ad%98%e7%9b%b8%e5%85%b3%e6%8c%87%e6%a0%87/</link>
		<comments>http://www.realqi.cn/2009/10/linux%e6%80%a7%e8%83%bd%e5%86%85%e5%ad%98%e7%9b%b8%e5%85%b3%e6%8c%87%e6%a0%87/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 03:24:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[系统管理]]></category>
		<category><![CDATA[运维监控]]></category>
		<category><![CDATA[cacti]]></category>
		<category><![CDATA[monitor]]></category>
		<category><![CDATA[perfermance]]></category>
		<category><![CDATA[system]]></category>

		<guid isPermaLink="false">http://realqi.cn/?p=447</guid>
		<description><![CDATA[本文是监控相关的基础知识系列文章之一,linux性能相关指标[监控一]  此文是经过相关的资料的收集和整理而来.
一、SWAP
    这个指标直接反映了系统内存问题,如果很多的SWAP空间被使用,一般你的系统内存不足

二、Cache
    当系统内存比应用需要的内存多的时候,系统会把数据cache在内存中,减少费时的IO操作

三、Buffer
      当应用程序在做写磁盘操作时,系统会把要写的数据buffer起来,等到一个触发点的时候,再把buffer中的数据刷新到磁盘,减少应用程序等待IO操作的时间.一般你在看一个运行长时间的系统时,会发现它的可用内存很少,但是Cache和Buffer很大,这是正常情况,系统会利用你的所有自由内存来cache数据,当它需要分配内存的时候,会把cache的数据放回到disk
]]></description>
			<content:encoded><![CDATA[<p><strong>一、SWAP<br />
</strong>    这个指标直接反映了系统内存的问题,如果有很多的SWAP空间被使用,一般能说明你系统的内存不足</p>
<p><strong>二、Cache</strong><br />
    当系统内存比应用需要的内存多的时候,系统会把数据cache在内存中,减少费时的IO操作</p>
<p><strong>三、Buffer</strong><br />
      当应用程序在做写磁盘操作时,系统会把要写的数据buffer起来,等到一个触发点的时候,再把buffer中的数据刷新到磁盘,减少应用程序等待IO操作的时间.一般你在看一个运行长时间的系统时,会发现它的可用内存很少,但是Cache和Buffer很大,这是正常情况,系统会利用你的所有自由内存来cache数据,当它需要分配内存的时候,会把cache的数据放回到disk</p>
<p><strong>四、Run Queue Statistics</strong><br />
      在linux中,process有两种状态: runnable，blocked waiting for an event to complete<br />
       一个blocked状态的process可能在等待一个I/O操作获取的数据,或者是一个系统调用的结果，<br />
 如果一个process在runnable状态,这就意味着它将同其他runnable状态的process等待CPU时间,而不是立即获得CPU时间,一个runnable状态的process不需要消耗CPU时间,只有当Linux调度进程从runnable队列中选择哪个process下次执行.<br />
当 process在runnable状态,当时等待CPU时间时,他们形成的等待队列称作Run Queue.<br />
Run Queue越大,表示等待的队列越长.<br />
性能工具通常显示runnable processes的数目和blocked processes的数目.</p>
<p><strong>五、load average</strong><br />
   系统的load是指running和runnable process的总和.<br />
   例如:如果有两个processes在running和有三个在等待运行(runnable),那么系统的load为五.  <br />
   Load average是指在指定时间内load的平均值.一般load average显示的三个数字的时间分别为1分钟,五分钟和十五分钟.</p>
<p><strong>六、Context Switches</strong><br />
    大部分现在的CPU在同一时间只能运行一个process.虽然也有一些CPU,例如超线程技术的CPU,能实现同时运行超过一个process,linux把这种CPU看作多个单线程CPU.</p>
<p>     linux内核不断的在不同process间切换,造成一个错觉,让人感觉一个单CPU同时处理多个任务.不同process之间的切换称作 Context Switch.切换Context会触发大量的信息移动,这是比较高的开销.</p>
<p>      context switches的产生<br />
      首先,kernel调度触发context switches.为了保证每个process平等的共享CPU时间,kernel周期性中断running的process,如果合适,kernel调度器会开始一个其它的process,当前的process停止执行,每次的周期性中断或者定时中断都可能触发context switch.每秒定时中断的次数因不同架构和不同的kernel版本而不同.</p>
<p>    获取每秒中断次数的一个简单办法是通过监控 /proc/interrupts文件</p>
<p><span lang="EN-US"><strong>七、Interrupts</strong> </span><br />
      CPU接收硬件驱动发出的中断请求.</p>
<p>       例如:如果一个磁盘控制器从磁盘上取得了一个数据块，kernel需要读取使用这个块,那么磁盘控制器就会触发一个中断.</p>
<p>      kernel接收每个中断,一个中断如果被处理器运行,那么这个中断被注册,否则,这个中断被忽略.在系统中,中断处理器的优先级非常高,执行速度非常快.</p>
<p>      有些中断处理并不需要很高的处理优先级,所以也有soft- interrupt handler.如果有很多的中断,kernel需要花费大量的时间去处理中断.可以检查/proc/interrupts能够知道中断发生在哪个CPU 上.</p>
<p><strong>八、CPU Utilization</strong><br />
<strong>     </strong><span lang="EN-US">CPU</span>有<span lang="EN-US">7个参数</span><span lang="EN-US"><br />
          1</span>、<span lang="EN-US">idle, </span>表示<span lang="EN-US">CPU</span>闲置并等待工作分配<span lang="EN-US">.</span></p>
<p><span lang="EN-US">          2</span>、<span lang="EN-US">user,</span>表示<span lang="EN-US">CPU</span>在运行用户的进程</p>
<p><span lang="EN-US">          3、system,</span>表示<span lang="EN-US">CPU</span>在执行<span lang="EN-US">kernel</span>工作</p>
<p><span lang="EN-US">          4、nice, </span>表示<span lang="EN-US">CPU</span>花费在被<span lang="EN-US">nice</span>改变过优先级的<span lang="EN-US">process</span>上的时间</p>
<p>  注意<span lang="EN-US">:</span>被<span lang="EN-US">nice</span>命令改变优先级的<span lang="EN-US">process</span>仅指那些<span lang="EN-US">nice</span>值为负的<span lang="EN-US">process.</span>花费在被<span lang="EN-US">nice</span>命令改变优先级的任务上的时间也将被计算在系统和用户时间内<span lang="EN-US">,</span>因此整个时间加起来可能会超过百分之百</p>
<p><span lang="EN-US">          5、iowait,</span>表示<span lang="EN-US">CPU</span>等待<span lang="EN-US">IO</span>操作完成的时间</p>
<p><span lang="EN-US">          6、irq,</span>表示<span lang="EN-US">CPU</span>开销在响应硬中断上的时间</p>
<p><span lang="EN-US">          7、softirq,</span>表示<span lang="EN-US">CPU</span>开销在响应软中断上的时间<span lang="EN-US">.</span><br />
<h3>相关文章</h3>
<ul class="related_post">
<li>2009年09月24日 -- <a href="http://www.realqi.cn/2009/09/show-a-cacti-monitor-mysql-graphp/" title="show a cacti-monitor-mysql graph">show a cacti-monitor-mysql graph (1)</a></li>
<li>2009年09月22日 -- <a href="http://www.realqi.cn/2009/09/%e5%88%86%e4%ba%ab%e4%b8%80%e4%b8%aacacti%e7%9b%91%e6%8e%a7cpu-%e7%9a%84%e6%a8%a1%e7%89%88/" title="分享一个cacti监控CPU 的模版.">分享一个cacti监控CPU 的模版. (0)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.realqi.cn/2009/10/linux%e6%80%a7%e8%83%bd%e5%86%85%e5%ad%98%e7%9b%b8%e5%85%b3%e6%8c%87%e6%a0%87/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TCP/IP Network Performance - Benchmarks and Tools</title>
		<link>http://www.realqi.cn/2009/09/tcpip-network-performance-benchmarks-and-tools/</link>
		<comments>http://www.realqi.cn/2009/09/tcpip-network-performance-benchmarks-and-tools/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 06:21:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[系统管理]]></category>
		<category><![CDATA[运维监控]]></category>
		<category><![CDATA[network measurement]]></category>

		<guid isPermaLink="false">http://realqi.cn/?p=382</guid>
		<description><![CDATA[价绍五个实用的,流行的,能从应用层和网络层用来进行网络测试或网络排错或进行衡量TCP/IP网络性的一些工具.]]></description>
			<content:encoded><![CDATA[<div id="cgDn">    价绍五个实用的,流行的,能从应用层和网络层用来进行网络测试或网络排错或进行衡量TCP/IP网络性的一些工具.</div>
<div> </div>
<div>一.测量网络性能的五项指标是：</div>
<div>
<ul>
<li>可用性（availability）</li>
<li>响应时间（response time）</li>
<li>网络利用率（network utilization）</li>
<li>网络吞吐量（network throughput）</li>
<li>网络带宽容量（network bandwidth capacity</li>
</ul>
</div>
<div>更多了解,请参考IBM <a href="http://www.ibm.com/developerworks/cn">developerWorks 中国</a><span>   </span><a href="http://www.ibm.com/developerworks/cn/linux/l-netperf/">netperf 与网络性能测量</a></div>
<div>
<p>这里特别推荐一个带宽测试工具 <a href="http://code.google.com/p/xjperf/">xjperf</a>  和一个用测试网络丢包率,响应时间,路由稳定性,的工具<a href="http://www.bitwizard.nl/mtr/">MTR</a></p>
<p> </p>
<p><strong>以下内容参考<a href="http://compnetworking.about.com/od/networkperformance/TCPIP_Network_Performance_Benchmarks_and_Tools.htm">这里</a></strong></p>
<p><strong> </strong></p>
<p><strong><a href="http://www.netperf.org/">Netperf</a></strong><br />
      An engineer at Hewlett-Packard developed Netperf to help the Unix network benchmarking community many years ago, and this benchmarking tool remains popular in Unix / Linux environments today.</p>
<p><strong><a href="http://clk.about.com/?zi=1/XJ/Ya&amp;sdn=compnetworking&amp;cdn=compute&amp;tm=1811&amp;gps=50_299_1252_829&amp;f=00&amp;tt=14&amp;bt=0&amp;bts=0&amp;zu=http%3A//clk.about.com/%3Fzi%3D1/XJ/Ya%26sdn%3Dcompnetworking%26cdn%3Dcompute%26tm%3D19%26gps%3D31_296_1252_829%26f%3D00%26tt%3D14%26bt%3D0%26bts%3D0%26zu%3Dhttp%253A//www.ittc.ku.edu/netspec/">NetSpec</a></strong><br />
      NetSpec strives to implement more realistic network performance testing scenarios than the standard utilities by acocunting for variable traffic flows. NetSpec is an academic research project that includes source code.</p>
<p><a href="http://dsd.lbl.gov/~boverhof/nettest.html"><strong>Nettest</strong><br />
</a>     Nettest is a simple latency and bendwidth performance benchmark for point-to-point TCP connections on Solaris and Linux.</p>
<p><strong><a href="http://www.pcausa.com/Utilities/pcattcp.htm">TTCP</a></strong><br />
      The Test TCP (TTCP) Benchmarking Tool measures network performance at the TCP and UDP level. Originally developed for Unix, TTCP has also been ported to Windows and other operating systems.</p>
<p><a href="http://www.ai3.net/products/dbs/"><strong>DBS - Distributed Benchmark System</strong><br />
</a>      The Distributed Benchmark System (DBS) is a performance benchmark tool for TCP/IP networks that attempts to expand on the capability of other tools in this category. DBS supports retransmission control and congestion avoidance performance evaluation across multiple dynamic connections.</p>
<p> </p></div>
<h3>相关文章</h3>
<ul class="related_post">
<li>No Related Post</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.realqi.cn/2009/09/tcpip-network-performance-benchmarks-and-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>分享一个cacti监控CPU 的模版.</title>
		<link>http://www.realqi.cn/2009/09/%e5%88%86%e4%ba%ab%e4%b8%80%e4%b8%aacacti%e7%9b%91%e6%8e%a7cpu-%e7%9a%84%e6%a8%a1%e7%89%88/</link>
		<comments>http://www.realqi.cn/2009/09/%e5%88%86%e4%ba%ab%e4%b8%80%e4%b8%aacacti%e7%9b%91%e6%8e%a7cpu-%e7%9a%84%e6%a8%a1%e7%89%88/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 07:22:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[技术实践]]></category>
		<category><![CDATA[系统管理]]></category>
		<category><![CDATA[运维监控]]></category>
		<category><![CDATA[cacti]]></category>
		<category><![CDATA[cacti template]]></category>

		<guid isPermaLink="false">http://realqi.cn/?p=289</guid>
		<description><![CDATA[增加了对iowait 的监控
增加了对硬中断(interrrupt)和软中断(softipt)的监控
此模版是在原ucd/net - CPU Usage基础之上做得更改
已在cacti0.87 {a.b.c d.e}上通过测试 ]]></description>
			<content:encoded><![CDATA[<p><a href="http://realqi.cn/wp-content/uploads/2009/09/cacti_graph_template_ucdnet_-_full_cpu_usage.xml">这个模版</a>的改进之处</p>
<ol>增加了对iowait 、硬中断(interrrupt)、软中断(softipt)的监控<br />
此模版是在原<strong>ucd/net - CPU Usage</strong>基础之上做得更改<br />
已在cacti0.87 {a.b.c d.e}上通过测试</ol>
<p><strong>请看下图</strong></p>
<p>cacti本身带的一个<strong>ucd/net - CPU Usage</strong>  模版,如下</p>
<p>              <img class="alignnone" src="http://farm3.static.flickr.com/2561/3944114080_e72f173d58.jpg" alt="" width="500" height="229" /></p>
<p>本人新建的模版<strong>ucd/net - Full CPU Usage</strong></p>
<p>             <img class="alignnone" src="http://farm3.static.flickr.com/2456/3943336341_83cbbae4f1.jpg" alt="" width="500" height="286" /></p>
<p><strong>如何使用本模版:</strong><br />
     1.下载模版 <a href="http://realqi.cn/wp-content/uploads/2009/09/cacti_graph_template_ucdnet_-_full_cpu_usage.xml">cacti_graph_template_ucdnet_-_full_cpu_usage</a><br />
     2.导入模版到cacti<br />
<h3>相关文章</h3>
<ul class="related_post">
<li>2009年10月15日 -- <a href="http://www.realqi.cn/2009/10/linux%e6%80%a7%e8%83%bd%e5%86%85%e5%ad%98%e7%9b%b8%e5%85%b3%e6%8c%87%e6%a0%87/" title="linux性能相关指标[监控基础知识一]">linux性能相关指标[监控基础知识一] (0)</a></li>
<li>2009年09月24日 -- <a href="http://www.realqi.cn/2009/09/show-a-cacti-monitor-mysql-graphp/" title="show a cacti-monitor-mysql graph">show a cacti-monitor-mysql graph (1)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.realqi.cn/2009/09/%e5%88%86%e4%ba%ab%e4%b8%80%e4%b8%aacacti%e7%9b%91%e6%8e%a7cpu-%e7%9a%84%e6%a8%a1%e7%89%88/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>安装LAMP环境(未完成版)</title>
		<link>http://www.realqi.cn/2009/09/%e5%ae%89%e8%a3%85lamp%e7%8e%af%e5%a2%83%e6%a0%87%e5%87%86%e7%89%88/</link>
		<comments>http://www.realqi.cn/2009/09/%e5%ae%89%e8%a3%85lamp%e7%8e%af%e5%a2%83%e6%a0%87%e5%87%86%e7%89%88/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 07:56:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[技术实践]]></category>
		<category><![CDATA[系统管理]]></category>
		<category><![CDATA[lamp]]></category>
		<category><![CDATA[system install]]></category>

		<guid isPermaLink="false">http://realqi.cn/?p=263</guid>
		<description><![CDATA[lamp环境安装.第一部份:系统安装 第二部份:apache,mysql,php安装  第三部份:相关安全优化]]></description>
			<content:encoded><![CDATA[<h2>一、系统安装</h2>
<p>   一、  系统安装</p>
<ol>
<li>准备工作:操作系统版本，规划分区信息，IP地址，掩码，网关，root口令</li>
<li>操作系统版本选择Centos4.7</li>
<li>分区    对于整个硬盘选择自动分区</li>
<li>配置静态IP,Gateway,DNS Server,Hostname（根据情况可不设定dns）</li>
<li>防火墙 选中 Remote Login(SSH)   选中 Web Server(HTTP,HTTPS)</li>
<li>安装方试可以通过光盘,pxe安装等   </li>
<li>语言:选择English(USA)</li>
<li>时区:Aisa/Shangai</li>
<li>软件包:选中</li>
</ol>
<pre>        X Window System
        GNOME Desktop Environmen
        Editors
        Development Tools
        X software Development
        Legacy Software Development</pre>
<p>  二、  安装后的必要配置</p>
<ol>
<li>修改默认运行级别为：3</li>
<pre> sed  -i -e  "s/id:5:initdefault:/id:3:initdefault:/" /etc/inittab</pre>
<li>配置时间同步：</li>
<pre> /usr/sbin/ntpdate 210.72.145.44</pre>
<li>修改启grup.conf的启动timeout=0</li>
<pre>  sed -i -e  "s/timeout=5/timeout=1/" /boot/grub/grub.conf</pre>
<li>关闭IPV6</li>
<pre>echo "alias net-pf-10 off" &gt;&gt; /etc/modprobe.conf
echo "alias ipv6 off" &gt;&gt; /etc/modprobe.conf
/sbin/chkconfig --level 35 ip6tables off</pre>
<li>关闭不必要的服务</li>
<pre>  for ser in `chkconfig --list   |grep 3:on |awk '{print $1}'`
            do
                echo $ser
                case $ser in
                  crond | irqbalance | microcode_ctl | network | random | sendmail \
                        | sshd | syslog | messagebus | haldaemon | readahead_early \
                        | apmd | readahead_later | readahead | iptables | lvm2-monitor | xinetd | auditd | cpuspeed )
                echo "Base services, Skip"
             ;;
             *)
                 echo "change $ser to off"
                 chkconfig --level 3 $ser off
                 service $ser stop

             ;;

                esac
        done
}</pre>
</ol>
<pre><span style="color: #ff0000;">相关资源
         1.适用于centos4 系列一个KS文件</span>
<span style="color: #ff0000;">         2. 系统配置脚本</span>
<span style="color: #ff0000;">         3.防火墙脚本</span></pre>
<h2>二、  编译安装基本环境</h2>
<p><span style="color: #ff0000;"><strong>  1、 编译安装MySQL</strong></span></p>
<pre>              tar zxvf mysql-5.1.30.tar.gz
              cd mysql-5.1.30
              groupadd mysql
              useradd -g mysql mysql -s /sbin/nologin
              ./configure --prefix=/usr/local/mysql \
                          --localstatedir=/usr/local/mysql/var \
                          --with-client-ldflags=-all-static \
                          --with-mysqld-ldflags=-all-static \
                          --enable-assembler  \
                          --without-innodb \
                          --without-isam \
                          --with-pthread \
                          --enable-thread-safe-client \
                          --with-extra-charsets=all
              make&amp;&amp;make install
              \cp –f support-files/my-medium.cnf /etc/my.cnf
              \cp –f support-files/mysql.server /etc/rc.d/init.d/mysqld
              chmod 700 /etc/rc.d/init.d/mysqld
              chkconfig --add mysqld
              cd /usr/local/mysql
              sed -i 's/skip-federated/#skip-federated/' /etc/my.cnf
              bin/mysql_install_db --user=mysql    
              chown -R root  .
              chown -R mysql var
              chgrp -R mysql .
              bin/mysqld_safe --user=mysql &amp;</pre>
<pre> <span style="color: #ff0000;">注意:</span> 1.可通过如下脚本测试mysql是否安装或启动成功
               export PATH=$PATH:/usr/local/mysql/bin/
             mysql -e 'SELECT VERSION();'
        如果返回如下显示,则安装成功否则请查看mysql的日志.
              +-----------+
              | VERSION() |
              +-----------+
              | 5.1.30      |
              +-----------+
           本例中mysql的日志文件为/usr/local/mysql/var/`hostname`.err</pre>
<p><span style="color: #ff0000;"><strong>     2、 编译安装Apache</strong></span></p>
<pre>              tar jxvf httpd-2.2.10.tar.bz2
              cd httpd-2.2.10
             ./configure  --prefix=/usr/local/apache2  \
                          --enable-static-support  \
                          --enable-static-htpasswd  \
                          --enable-static-htdigest  \
                          --enable-static-rotatelogs  \
                          --enable-static-logresolve  \
                          --enable-static-ab  \
                          --enable-static-checkgid  \
                          --enable-so  \
                          --enable-authz-host  \
                          --enable-mime  \
                          --enable-dir  \
                          --enable-log-config  \
                          --enable-auth-basic=shared  \
                          --enable-authn-file=shared  \
                          --disable-authn-default  \
                          --disable-authz-groupfile  \
                          --disable-authz-user  \
                          --disable-authz-default  \
                          --disable-include  \
                          --disable-filter  \
                          --disable-charset-lite  \
                          --disable-env  \
                          --disable-setenvif  \
                          --enable-autoindex  \
                          --disable-asis  \
                          --disable-cgid  \
                          --enable-cgi  \
                          --enable-negotiation=shared  \
                          --enable-actions=shared  \
                          --enable-alias  \
                          --enable-dav=shared \
                          --enable-dav-fs=shared
              make&amp;&amp;make install
 </pre>
<p><span style="color: #ff0000;"><strong>  3、 编译安装PHP</strong></span></p>
<pre>              tar jxvf php-5.2.6.tar.bz2 
              cd php-5.2.6
              ./configure --prefix=/usr/local/php \
                             --with-apxs2=/usr/local/apache2/bin/apxs \
                             --with-pear --with-zlib-dir \
                             --with-libxml-dir --with-gd \
                             --enable-gd-native-ttf \
                             --enable-gd-jis-conv \
                             --with-freetype-dir --with-jpeg-dir \
                             --with-png-dir --with-ttf=shared \
                             --enable-mbstring \
                             --with-mysql=/usr/local/mysql \
                             --with-mysqli=/usr/local/mysql/bin/mysql_config \
                             --with-config-file-path=/etc --with-iconv \
                             --disable-ipv6 --enable-static \
                             --enable-zend-multibyte \
                             --enable-inline-optimization \
                             --enable-zend-multibyte \
                             --enable-sockets \
                             --enable-soap --with-openssl \
                             --with-gettext
              make&amp;&amp;make install</pre>
<p><strong><span style="color: #ff0000;">  4、 编译安装rrdtool(此软件不需要装,我在这里写出是因为我本人需要用这个做一些监控)</span></strong></p>
<pre>               tar zxvf rrdtool-1.2.29.tar.gz
               cd rrdtool-1.2.29
               yum install -y libart_lgpl-devel.i386
               ./configure  --prefix=/usr \
                            --disable-tcl  --disable-ruby
               make&amp;&amp;make install</pre>
<h2>三、  整合Apache与PHP                  </h2>
<pre> vi /usr/local/apache2/config/httpd.conf
        1.添加用于解析以.php结尾的文件的指令   
                AddType application/x-httpd-php .php .phtml
                AddType application/x-httpd-php-source .phps  
        2.修改默认打开的页面为index.php 找到
                &lt;IfModule dir_module&gt;
                      DirectoryIndex index.html
                &lt;/IfModule&gt;
       修改成：
                   &lt;IfModule dir_module&gt;
                     DirectoryIndex  index.php index.html
                &lt;/IfModule&gt;</pre>
<p>可用下面的脚本来进行</p>
<pre>file=/usr/local/apache2/conf/httpd.conf
sed -i '309 a\ AddType application/x-httpd-php .php .phtml\n AddType application/x-httpd-php-source .phps' $file
sed -i 's/DirectoryIndex index.html/DirectoryIndex index.php index.html/' $file</pre>
<p>  找到：      </p>
<pre>            #Include conf/extra/httpd-mpm.conf
            #Include conf/extra/httpd-info.conf
            #Include conf/extra/httpd-default.conf</pre>
<p>     分别去掉前面的#保存退出</p>
<p>     测试整合        </p>
<pre>            echo   '&lt;?php phpinfo(); ?&gt;' &gt;/usr/local/apache2/htdocs/index.php
            /usr/local/apache2/bin/apachectl restart</pre>
<h2>四、  系统初化配置</h2>
<p>             1、vi conf/extra/httpd-default.conf  修改以下列出的几项为如下                </p>
<pre>            ServerTokens Prod
            ServerSignature Off
            HostnameLookups Off</pre>
<p>           2、vi conf/extra/httpd-info.conf</p>
<pre>            &lt;Location /server-status&gt;
                      SetHandler server-status
                      Order deny,allow
                      Deny from all
                      Allow from 10.11 127.0.0.1
            &lt;/Location&gt;
            ExtendedStatus On</pre>
<h3>相关文章</h3>
<ul class="related_post">
<li>2009年10月15日 -- <a href="http://www.realqi.cn/2009/10/apache%e9%85%8d%e7%bd%ae%e8%99%9a%e6%8b%9f%e4%b8%bb%e6%9c%ba%e7%9a%84%e4%b8%89%e7%a7%8d%e6%96%b9%e6%b3%95/" title="APACHE配置虚拟主机的三种方法">APACHE配置虚拟主机的三种方法 (0)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.realqi.cn/2009/09/%e5%ae%89%e8%a3%85lamp%e7%8e%af%e5%a2%83%e6%a0%87%e5%87%86%e7%89%88/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>REDHAT CLUSTER SUIT WITH GFS</title>
		<link>http://www.realqi.cn/2009/09/redhat-cluster-suit-with-gfs-2/</link>
		<comments>http://www.realqi.cn/2009/09/redhat-cluster-suit-with-gfs-2/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 07:32:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[技术实践]]></category>
		<category><![CDATA[系统管理]]></category>
		<category><![CDATA[gfs]]></category>
		<category><![CDATA[rhcs]]></category>

		<guid isPermaLink="false">http://realqi.cn/2009/09/redhat-cluster-suit-with-gfs-2/</guid>
		<description><![CDATA[          RHCS（REDHAT CLUSTER SUIT）是一款能够提供高性能、高可靠性、负载均衡、高可用性的集群工具集,一个集群通常有两个或两个以上的计算机（称为“节点”或”成员“）共同执行一个任务。其中有四种常见集群：

本篇主要介绍一些概念.不讲操作]]></description>
			<content:encoded><![CDATA[<li>redhat cluster suit 介绍</li>
<li>redhat cluster suit 组件</li>
<h2>一、redhat cluster suit 介绍</h2>
<p>          RHCS（REDHAT CLUSTER SUIT）是一款能够提供高性能、高可靠性、负载均衡、高可用性的集群工具集,一个集群通常有两个或两个以上的计算机（称为“节点”或”成员“）共同执行一个任务。其中有四种常见集群：</p>
<ul>
<li><strong>存储集群<br />
</strong></li>
</ul>
<p>           存储集群在一个集群中为服务提供一个一致的文件系统映像，允许服务同时去读写一个单一的共享文件系统。存储集群通过将数据放到一个共享文件系统中从而消除了在应用程序间拷贝数据的麻烦，并提供一个单一的备份和故障恢复点。Red Hat Cluster Suite通过Red Hat GFS提供一个存储集群。</p>
<ul>
<li><strong>高可用性集群 </strong></li>
</ul>
<p>         高可用性集群通过消除单一故障点和节点故障转移功能（当一个集群节点失败后将服务转移到其他节点上）来提供高可用性。节点故障转移功能对客户端是透明的，当节点失败后客户端并不会看到节点之间的服务转移。Red Hat Cluster Suite通过高可用性服务管理组件来提供一个高可用性集群。</p>
<ul>
<li><strong>负载均衡 </strong></li>
</ul>
<p>          负载均衡集群将服务请求调度到集群中的多个节点上。负载均衡是一个低成本、高可用性的集群，因为你可以根据负载情  况灵活的添加和删除节点。在负载均衡集群中当一个节点失败后，调度器会发现这个失败并停止向此节点发送请求。节点的失败对于客户端是透明的。Red Hat Cluster Suite 通过LVS（Linux Virtual Server）来提供负载均衡集群。</p>
<ul>
<li><strong>高性能集群</strong></li>
</ul>
<p>           高性能集群在节点上执行并行计算。高性能集群允许应用程序并行计算从而提高应用程序性能。</p>
<h2>二、RHCS主要组件：</h2>
<ul>
<li><strong>集群架构</strong></li>
</ul>
<p>              提供一个基本功能使节点作为集群工作在一起：配置文件管理，成员关系管理，锁管理和栅设备。</p>
<ul>
<li><strong>高可用性服务管理</strong></li>
</ul>
<p>              提供节点失败转移服务，当一个节点失败后将服务转移到另一个节点上。</p>
<ul>
<li><strong>集群管理工具</strong></li>
</ul>
<p>             通过配置和管理工具来配置和管理Red Hat集群。</p>
<ul>
<li><strong>Linux Virtual Server (LVS)</strong></li>
</ul>
<p>             LVS提供一个基于IP的负载均衡功能，通过LVS可以将客户请求均匀的分配到集群节点上。</p>
<h2>三、其它Red Hat集群组件：</h2>
<ul>
<li><strong>Red Hat GFS (Global File System)</strong></li>
</ul>
<p>            GFS为Red Hat Cluster Suite提供一个集群文件系统，CFS允许多个节点在块级别上共享存储。</p>
<ul>
<li><strong>Cluster Logical Volume Manager (CLVM)</strong></li>
</ul>
<p>            提供逻辑卷管理集群存储。</p>
<ul>
<li><strong>Global Network Block Device (GNBD)</strong></li>
</ul>
<p>           GFS的一个补充组件用于将存储在块级别导出到以太网上。更参请参考：<a href="http://www.redhat.com/docs/manuals/enterprise/RHEL-5-manual/en-US/RHEL510/Cluster_Suite_Overview/s1-rhcs-intro-CSO.html#fig-intro-cluster-CSO">http://www.redhat.com/docs/manuals/enterprise/RHEL-5-manual/en-US/RHEL510/Cluster_Suite_Overview/s1-rhcs-intro-CSO.html#fig-intro-cluster-CSO</a></p>
<h2>四、集群管理器</h2>
<ul>
<li><strong>布式集群管理器(CMAN/DLM)</strong></li>
</ul>
<p>         CMAN是一个分布式集群管理器（DLM），它运行在每一个集群节点上，CMAN通过监视集群节点提供一个法定节点数（quorum），当集群中有多于一半的节点处于活跃状态时,此时符合法定节点数，集群继续可用，当只有有一半或少于一半的节点处于活跃状态是则已达到不到法定节点数，此时整个集群变得不可用。CMAN通过监控集群中节点来确定各节点的成员关系，当集群中的成员关系发生改变，CMAN会通架构中其它组件来进行相应的调整。</p>
<p align="left">                                          CMAN/DLM Overview</p>
<p align="left"><img class="aligncenter" src="http://www.redhat.com/docs/manuals/enterprise/RHEL-5-manual/en-US/RHEL510/Cluster_Suite_Overview/images/DLM_Overview.png" alt="" width="620" height="320" /></p>
<p>              图片引用：<a href="http://www.redhat.com/docs/manuals/enterprise/RHEL-5-manual/en-US/RHEL510/Cluster_Suite_Overview/images/DLM_Overview.png">http://www.redhat.com/docs/manuals/enterprise/RHEL-5-manual/en-US/RHEL510/Cluster_Suite_Overview/images/DLM_Overview.png</a></p>
<ul>
<li><strong>DLM锁管理</strong></li>
</ul>
<p>        分布式锁管理器，它运行在所有的集群节点上，锁管理是一个公共的基础结构，为集群提供一种共享集群资源的管理机制，GFS通过锁管理器使用锁机制来同步访问文件系统元数据，CLVM通过锁管理器来同步更新数据到LVM卷和卷组。详细参考：<a href="http://www.redhat.com/docs/manuals/enterprise/RHEL-5-manual/en-US/RHEL510/Cluster_Suite_Overview/s2-clumembership-overview-CSO.html">http://www.redhat.com/docs/manuals/enterprise/RHEL-5-manual/en-US/RHEL510/Cluster_Suite_Overview/s2-clumembership-overview-CSO.html</a></p>
<ul>
<li><strong>数据的完整保证</strong></li>
</ul>
<p>         RHCS 通过 Fence设备从共享存储切断失效节点的I/O以保证数据的完整性。当CMAN确定一个节点失败后，它在集群结构中通告这个失败的节点（组播），fenced进程会将失败的节点隔离，以保证失败节点不破坏共享数据。Fenced运行在每个节点上更多详细的介绍：<a href="http://www.redhat.com/docs/manuals/enterprise/RHEL-5-manual/en-US/RHEL510/Cluster_Suite_Overview/s2-fencing-overview-CSO.html">http://www.redhat.com/docs/manuals/enterprise/RHEL-5-manual/en-US/RHEL510/Cluster_Suite_Overview/s2-fencing-overview-CSO.html</a></p>
<p>  fence 设备：<a href="http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Configuration_Example_-_Fence_Devices/index.html">http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Configuration_Example_-_Fence_Devices/index.html</a></p>
<ul>
<li><strong>Rgmanger/gulm()</strong></li>
<p> </ul>
<h2>五、REDHAT集群配置及工具</h2>
<p>          集群配置系统（CCS）管理集群配置，并为其他集群结构提供配置信息。CCS运行在每个节点上并确保集群配置文件在每个节点上是最新的。举例，假如管理员在节点A上更新配置文件，CCS负责传播更新到其他节点上。</p>
<ul>
<li><strong>集群配置文件</strong></li>
</ul>
<p>           <strong>集群配置文件</strong>：(/etc/cluster/cluster.conf) 是一个XML文件，用来描述下面的集群特性：<br />
<strong>                集群名称:</strong>列出集群名称、集群配置文件版本和一个隔离时间，隔离相应时间当一个新节点加入或从集群中隔离时。<br />
       <strong>               集群:</strong>列出集群中的每一个节点，指定节点名称，节点ID，法定投票数，和栅模式。<br />
 <strong>             fence设备:</strong>定义fence设备。<br />
<strong>                管理资源:</strong>定义创建集群服务需要的资源。管理资源包括失败转移域，资源（如IP）和服务。<br />
<span style="color: #ff0000;">  更多详细：man cluster.conf</span></p>
<ul>
<li><strong>配置工具价绍</strong></li>
</ul>
<p><strong>             1、Cronga</strong><br />
                  是一个集中化的的集群管理器，主要用于管理集群中的节点和集群中的存储。主要特性如下：<br />
                           1．  通过一个WEB 界面管理集群和存住储<br />
                           2．  自动化部署集群节点和存储<br />
                           3．  可以很容易的整合进已存在的集群<br />
                           4．  合的的验证机制<br />
                           5．  集中化的集群节点状态及日志管理<br />
                           6．  细致化的权限控制<br />
<span style="color: #ff0000;">                         更多详细了解请参考：</span><a href="http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/4.8/html/Cluster_Administration/s1-conga-overview-CA.html">http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/4.8/html/Cluster_Administration/s1-conga-overview-CA.html</a></p>
<p><span style="color: #ff0000;"><strong><span style="color: #000000;">     </span></strong></span><br />
<span style="color: #ff0000;"><strong><span style="color: #000000;">      </span></strong></span><strong>       2、</strong><span style="color: #ff0000;"><strong><span style="color: #000000;">system-config-cluster</span></strong></span><span style="color: #ff0000;"><strong><br />
                        </strong></span>参考:<a href="http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/4.8/html/Cluster_Administration/s1-clumgmttools-overview-CA.html">http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/4.8/html/Cluster_Administration/s1-clumgmttools-overview-CA.html</a></p>
<p><span style="color: #ff0000;"><strong><span style="color: #000000;">      </span></strong></span><strong>       3、</strong><strong>命令行管理</strong></p>
<ul>
<li><strong>配置工具的使用</strong></li>
</ul>
<p>             在进行配置之前请阅读：<a href="http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/4.8/html/Cluster_Administration/ch-before-config-CA.html%20">Before Configuring a Red Hat Cluster</a></p>
<p><strong>                        1、Cronga<br />
</strong>                              安装及启动：<a href="http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/4.8/html/Cluster_Administration/s1-start-luci-ricci-conga-CA.html">http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/4.8/html/Cluster_Administration/s1-start-luci-ricci-conga-CA.html</a></p>
<p>                             全局配置参数：<a href="http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/4.8/html/Cluster_Administration/s1-general-prop-conga-CA.html">http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/4.8/html/Cluster_Administration/s1-general-prop-conga-CA.html</a></p>
<p><strong>                      2、命令行配置工具</strong><br />
                             参考以下连接</p>
<p align="left">                                     <a title="6.1. Starting and Stopping the Cluster Software" href="http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/4.8/html/Cluster_Administration/ch-mgmt-scc-CA.html#s1-admin-start-CA">Starting and Stopping the Cluster Software</a></p>
<p align="left">                                     <a title="6.2. Managing High-Availability Services" href="http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/4.8/html/Cluster_Administration/s1-admin-service-CA.html">Managing High-Availability Services</a></p>
<p align="left">                                     <a title="6.4. Backing Up and Restoring the Cluster Database" href="http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/4.8/html/Cluster_Administration/s1-admin-backup-CA.html">Backing Up and Restoring the Cluster Database</a></p>
<p align="left">                                     <a title="6.5. Disabling the Cluster Software" href="http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/4.8/html/Cluster_Administration/s1-admin-disable-CA.html">Disabling the Cluster Software</a></p>
<p align="left">                                     <a title="6.6. Diagnosing and Correcting Problems in a Cluster" href="http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/4.8/html/Cluster_Administration/s1-admin-problems-CA.html">Diagnosing and Correcting Problems in a Cluster</a></p>
<h2> 六、GFS 简要说明</h2>
<p>           GFS是GOOGLE实现的是一个可扩展的分布式文件系统，用于大型的、分布式的、对大量数据进行访问的应用。它运行于廉价的普通硬件上，但可以提供容错功能。它可以给大量的用户提供总体性能较高的服务。更深入了解，请参考:<a href="http://www.codechina.org/doc/google/gfs-paper/introduction.html">http://www.codechina.org/doc/google/gfs-paper/introduction.html</a></p>
<p>            Redhat 的GFS 可以根据对性能或是，可扩展性，或者以经济性多个原则进行不同方案的部署，参考：<a href="http://www.redhat.com/docs/manuals/csgfs/admin-guide/s1-ov-perform.html#S2-OV-SUPERIOR">http://www.redhat.com/docs/manuals/csgfs/admin-guide/s1-ov-perform.html#S2-OV-SUPERIOR</a></p>
<p>         GFS（Global File System）自己以本地文件系统的形式出现。多个Linux机器通过网络共享存储设备，每一台机器都可以将网络共享磁盘看作是本地磁盘，如果某台机器对某个文件执行了些操作，则后来访问此文件的机器就会读到写以后的结果。</p>
<p align="left">         GFS 主要组件，集群卷管理，锁管理，集群管理，围栏和恢复，集群配置管理</p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=ab0eb095-7c05-87ce-852d-b9a8c2cb65db" alt="" /></div>
<h3>相关文章</h3>
<ul class="related_post">
<li>2009年08月31日 -- <a href="http://www.realqi.cn/2009/08/centos5-install-gfs/" title="centos5 install gfs">centos5 install gfs (2)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.realqi.cn/2009/09/redhat-cluster-suit-with-gfs-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>postgresql 分布式查询方法</title>
		<link>http://www.realqi.cn/2009/09/postgresql-%e5%88%86%e5%b8%83%e5%bc%8f%e6%9f%a5%e8%af%a2%e6%96%b9%e6%b3%95/</link>
		<comments>http://www.realqi.cn/2009/09/postgresql-%e5%88%86%e5%b8%83%e5%bc%8f%e6%9f%a5%e8%af%a2%e6%96%b9%e6%b3%95/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 06:56:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[pgsql]]></category>
		<category><![CDATA[基础知识]]></category>
		<category><![CDATA[技术实践]]></category>
		<category><![CDATA[plproxy]]></category>

		<guid isPermaLink="false">http://realqi.cn/2009/09/postgresql-%e5%88%86%e5%b8%83%e5%bc%8f%e6%9f%a5%e8%af%a2%e6%96%b9%e6%b3%95/</guid>
		<description><![CDATA[转:http://www.qtchina.net/?q=node/322
1. 使用pgpoll-II 的并行查询功能，可以同时执行多服务器查询语句
2. 使用PL/Proxy,
3. 商业方法，EnterpriseDB Postgres Plus中有一个In-Memory Distributed Caching Layer或者可以解决多个数据库间进行数据处理，EnterpriseDB的GridSQL也可以实现分布式的数据库应用
相关文章

2009年09月3日 -- PostgreSQL partitioning with plproxy (PART 1) (2)

]]></description>
			<content:encoded><![CDATA[<p>转:<a href="http://www.qtchina.net/?q=node/322">http://www.qtchina.net/?q=node/322</a></p>
<p>1. 使用pgpoll-II 的并行查询功能，可以同时执行多服务器查询语句</p>
<p>2. 使用PL/Proxy,</p>
<p>3. 商业方法，EnterpriseDB Postgres Plus中有一个In-Memory Distributed Caching Layer或者可以解决多个数据库间进行数据处理，EnterpriseDB的GridSQL也可以实现分布式的数据库应用<br />
<h3>相关文章</h3>
<ul class="related_post">
<li>2009年09月3日 -- <a href="http://www.realqi.cn/2009/09/postgresql-partitioning-with-plproxy/" title="PostgreSQL partitioning with plproxy (PART 1)">PostgreSQL partitioning with plproxy (PART 1) (2)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.realqi.cn/2009/09/postgresql-%e5%88%86%e5%b8%83%e5%bc%8f%e6%9f%a5%e8%af%a2%e6%96%b9%e6%b3%95/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DRBD (Distributed Replicated Block Device)</title>
		<link>http://www.realqi.cn/2009/09/drbd-distributed-replicated-block-device/</link>
		<comments>http://www.realqi.cn/2009/09/drbd-distributed-replicated-block-device/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 04:43:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[基础知识]]></category>
		<category><![CDATA[DRDB]]></category>
		<category><![CDATA[HA]]></category>

		<guid isPermaLink="false">http://realqi.cn/?p=188</guid>
		<description><![CDATA[主要说明什么时DRBD
======
转:http://www.drbd.org/home/what-is-drbd/
======
1、架构
 
        DRBD® refers to block devices designed as a building block to form high availability (HA) clusters. This is done by mirroring a whole block device via an assigned network. DRBD can be understood as network based raid-1.
In the illustration above, the two orange boxes represent two servers that form an HA cluster. The boxes contain the usual components of a  <a href="http://www.realqi.cn/2009/09/drbd-distributed-replicated-block-device/" class="more-link">更多 &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>主要说明什么时DRBD</p>
<p>======<br />
转:http://www.drbd.org/home/what-is-drbd/<br />
======</p>
<p>1、架构</p>
<p><img class="alignnone" src="http://www.drbd.org/uploads/pics/overview_02.gif" alt="" width="587" height="329" /> </p>
<p>        DRBD<sup>®</sup> refers to block devices designed as a building block to form high availability (HA) clusters. This is done by mirroring a whole block device via an assigned network. DRBD can be understood as network based raid-1.</p>
<p>In the illustration above, the two orange boxes represent two servers that form an HA cluster. The boxes contain the usual components of a Linux™ kernel: file system, buffer cache, disk scheduler, disk drivers, TCP/IP stack and network interface card (NIC) driver. The black arrows illustrate the flow of data between these components.</p>
<p>The orange arrows show the flow of data, as DRBD mirrors the data of a high availably service from the active node of the HA cluster to the standby node of the HA cluster.</p>
<p>=========<br />
转:<a href="http://www.turbolinux.com.cn/turbo/wiki/doku.php?id=%E7%B3%BB%E7%BB%9F%E7%AE%A1%E7%90%86:drbd%E7%9A%84%E4%BD%BF%E7%94%A8">http://www.turbolinux.com.cn/turbo/wiki/doku.php?id=%E7%B3%BB%E7%BB%9F%E7%AE%A1%E7%90%86:drbd%E7%9A%84%E4%BD%BF%E7%94%A8</a><br />
=========</p>
<p><span>  DRBD</span>是一种块设备,可以被用于高可用(HA)之中.它类似于一个网络RAID-1功能.当你将数据写入本地<br />
文件系统时,数据还将会被发送到网络中另一台主机上.以相同的形式记录在一个文件系统中.<br />
本地(主节点)与远程主机(备节点)的数据可以保证实时同步.当本地系统出现故障时,远程主机上还会<br />
保留有一份相同的数据,可以继续使用.</p>
<p>在高可用(HA)中使用<span>DRBD</span>功能,可以代替使用一个共享盘阵.因为数据同时存在于本地主机和远程主机上,<br />
切换时,远程主机只要使用它上面的那份备份数据,就可以继续进行服务了.<br />
<h3>相关文章</h3>
<ul class="related_post">
<li>No Related Post</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.realqi.cn/2009/09/drbd-distributed-replicated-block-device/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>centos5 install gfs</title>
		<link>http://www.realqi.cn/2009/08/centos5-install-gfs/</link>
		<comments>http://www.realqi.cn/2009/08/centos5-install-gfs/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 07:57:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[系统管理]]></category>
		<category><![CDATA[经验技巧]]></category>
		<category><![CDATA[centos5]]></category>
		<category><![CDATA[gfs]]></category>

		<guid isPermaLink="false">http://realqi.cn/?p=152</guid>
		<description><![CDATA[环境说明：
        centos5.2+iscsi+gfs
1、安装centos5.2：
          最小化安装系统三台
2、初始化三台系统：
          1、关闭不必要的服务
turnseroff( )
        {
        for ser in `chkconfig --list   &#124;grep 3:on &#124;awk '{print $1}'`
        do
                echo $ser
                case $ser in
                  crond &#124; irqbalance &#124; microcode_ctl &#124; network &#124; random &#124; sendmail \
                        &#124; sshd &#124; syslog &#124; messagebus &#124; haldaemon &#124; readahead_early \
                        &#124; apmd &#124; readahead_later &#124; readahead &#124; iptables &#124; lvm2-monitor  <a href="http://www.realqi.cn/2009/08/centos5-install-gfs/" class="more-link">更多 &#62;</a>]]></description>
			<content:encoded><![CDATA[<h3>环境说明：</h3>
<p>        centos5.2+iscsi+gfs</p>
<h3>1、安装centos5.2：</h3>
<p>          最小化安装系统三台</p>
<h3>2、初始化三台系统：</h3>
<p>    <strong><span style="color: #ff0000;">      1、关闭不必要的服务</span></strong></p>
<blockquote><p>turnseroff( )<br />
        {<br />
        for ser in `chkconfig --list   |grep 3:on |awk '{print $1}'`<br />
        do<br />
                echo $ser<br />
                case $ser in<br />
                  crond | irqbalance | microcode_ctl | network | random | sendmail \<br />
                        | sshd | syslog | messagebus | haldaemon | readahead_early \<br />
                        | apmd | readahead_later | readahead | iptables | lvm2-monitor | xinetd | auditd | cpuspeed )<br />
                echo "Base services, Skip"<br />
             ;;<br />
             *)<br />
                 echo "change $ser to off"<br />
                 chkconfig --level 3 $ser off<br />
                 service $ser stop<br />
 <br />
             ;;<br />
 <br />
                esac<br />
        done<br />
}<br />
turnseroff</p></blockquote>
<p><strong><span style="color: #ff0000;">          2、修改yum 源</span></strong></p>
<blockquote><p>#change the yum source<br />
\cp -f /etc/yum.repos.d/CentOS-Base.repo ~/<br />
cat &lt;/etc/yum.repos.d/CentOS-Base.repo<br />
[lan]<br />
name=LAN<br />
baseurl=ftp://10.20.2.11/centos52<br />
gpgcheck=1<br />
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5</p>
<p>EOF</p></blockquote>
<p>     <strong><span style="color: #ff0000;">     3、添加vi 语法高亮</span></strong></p>
<blockquote><p>aliasvi ()<br />
{<br />
        sed -i "8 s/^/alias vi='vim'/" /root/.bashrc</p>
<p>        source /root/.bashrc<br />
}<br />
aliasvi</p></blockquote>
<p><strong><span style="color: #ff0000;">          4、关闭防火墙</span></strong></p>
<blockquote><p>service iptables stop<br />
chkconfig iptables off</p>
<p> </p></blockquote>
<h3>3、安装需要的软件包</h3>
<blockquote><p>  yum install -y cman gfs-utils kmod-gfs kmod-dlm  cluster-snmp iscsi-initiator-utils lvm2-cluster  rgmanager</p></blockquote>
<p>如查有报错，直接导入KEY 参考：</p>
<h3>4、在每个节点上持载iscsi共享存储</h3>
<p>有关iscis 相关请参考：</p>
<blockquote><p>service iscsi restart<br />
iscsiadm --mode discovery --type sendtargets --portal 10.20.15.249<br />
service iscsi restart</p></blockquote>
<p>fdisk -l 会多一个20.3GB 的sdb</p>
<h3>5、在其中一个节点上上创建一个名为gfscg的 LVM 卷组</h3>
<blockquote><p>pvcreate -ff  /dev/sdb<br />
vgcreate  gfsvg /dev/sdb</p></blockquote>
<p>列出VG大小：</p>
<blockquote><p>vgdisplay  gfsvg |grep "Total PE "</p>
<p><span style="color: #ff0000;">  Total PE              4847</span></p></blockquote>
<p>创建lv</p>
<blockquote><p>lvcreate -l 4847  -n gfs gfsvg</p></blockquote>
<h3>5、在其中一个节点上上创建一个GFS卷</h3>
<p>        1、确认cluster name</p>
<blockquote><p>    cman_tool status |grep "Cluster Name"<br />
<span style="color: #ff0000;">   Cluster Name: gfs_cluster</span></p></blockquote>
<p><span style="color: #000000;">       2、创建GFS 文件系统</span></p>
<blockquote><p>gfs_mkfs -j 5 -p lock_dlm -t gfs_cluster:gfs /dev/gfsvg/gfs</p></blockquote>
<p>相关参数请参考：</p>
<p>6、配置节点做集群</p>
<p>    1、分别在三台机器上添加主机名到ip的映设</p>
<blockquote><p>echo "10.20.15.151 clustera"  &gt;&gt;/etc/hosts<br />
echo "10.20.15.152 clusterb"  &gt;&gt;/etc/hosts<br />
echo "10.20.15.153 clusterc"  &gt;&gt;/etc/hosts</p></blockquote>
<p>  2、创建集群配置文件,并分别复制到每个节点上</p>
<blockquote><p><strong> cat &lt;&lt;EOF  &gt;/etc/cluster/cluster.conf</strong><br />
&lt;?xml version="1.0"?&gt;<br />
&lt;cluster alias="gfs_cluster" config_version="2" name="gfs_cluster"&gt;<br />
        &lt;fence_daemon post_fail_delay="0" post_join_delay="3"/&gt;<br />
        &lt;clusternodes&gt;<br />
                &lt;clusternode name="clustera" nodeid="1" votes="1"&gt;<br />
                        &lt;fence&gt;<br />
                                &lt;method name="1"/&gt;<br />
                        &lt;/fence&gt;<br />
                &lt;/clusternode&gt;<br />
                &lt;clusternode name="clusterb" nodeid="2" votes="1"&gt;<br />
                        &lt;fence&gt;<br />
                                &lt;method name="1"/&gt;<br />
                        &lt;/fence&gt;<br />
                &lt;/clusternode&gt;<br />
                &lt;clusternode name="clusterc" nodeid="3" votes="1"&gt;<br />
                        &lt;fence/&gt;<br />
                &lt;/clusternode&gt;<br />
        &lt;/clusternodes&gt;<br />
        &lt;cman/&gt;<br />
        &lt;fencedevices&gt;<br />
                &lt;fencedevice agent="fence_manual" name="manual"/&gt;<br />
        &lt;/fencedevices&gt;<br />
        &lt;rm&gt;<br />
                &lt;failoverdomains&gt;<br />
                        &lt;failoverdomain name="failover" ordered="0" restricted="0"/&gt;<br />
                &lt;/failoverdomains&gt;<br />
                &lt;resources&gt;<br />
                        &lt;clusterfs device="/dev/gfsvg/gfs" force_unmount="0" fsid="32101" fstype="gfs" mountpoint="/opt/pgfsql" name="gfsmount" options="-t gfs"/&gt;<br />
                &lt;/resources&gt;<br />
        &lt;/rm&gt;<br />
&lt;/cluster&gt;<br />
 <br />
<strong>EOF</strong></p></blockquote>
<h3>7、在每一个节点上启动相关服务</h3>
<p>以下命令在每个节点上执行</p>
<blockquote><p> for   ser in iscis gfs gfs2 cman clvmd<br />
        do<br />
             chkconfig $ser on<br />
 done</p></blockquote>
<blockquote><p>for ser in  gfs gfs2 cman clvmd<br />
do<br />
service $ser restat<br />
done</p></blockquote>
<h3>8、确认集群各节点的状态</h3>
<p>    1、clustat 如下图:</p>
<blockquote><p><span style="color: #ff0000;"><span style="color: #000000;">[root@pgsqla scripts]# clustat<br />
Cluster Status for gfs_cluster @ Wed Sep  2 23:13:20 2009<br />
Member Status: Quorate</span><br />
 <br />
 Member Name                                                     ID   Status<br />
 ------ ----                                                     ---- ------<br />
 clustera                                                            1 Online, Local<br />
 clusterb                                                            2 Online<br />
 clusterc                                                            3 Online<br />
 <br />
<span style="color: #000000;">[root@pgsqla scripts]#</span></span></p></blockquote>
<p><span style="color: #ff0000;"><span style="color: #000000;"><strong>Online 说明节点正常,反之为<span style="color: #ff0000;">offlice  ,<span style="color: #000000;">可以通过cat /var/log/messages 得到相关信息</span></span></strong></span></span></p>
<h3>9、命令行集群管理工具</h3>
<p><strong> 1、cman_tool</strong></p>
<blockquote><p>Usage:<br />
 <br />
cman_tool &lt;join|leave|kill|expected|votes|version|wait|status|nodes|services|debug&gt; [options]</p></blockquote>
<p><strong> 2、ccs_tool</strong></p>
<blockquote><p>Usage::<br />
  ccs_tool [options] &lt;command&gt;<br />
 <br />
Options:<br />
  -h                  Print this usage and exit.<br />
  -V                  Print version information and exit.<br />
 <br />
Commands:<br />
  help                Print this usage and exit.<br />
  update &lt;xml file&gt;   Tells ccsd to upgrade to new config file.<br />
  upgrade &lt;location&gt;  Upgrade old CCS format to new xml format.<br />
  addnode &lt;node&gt;      Add a node<br />
  delnode &lt;node&gt;      Delete a node<br />
  lsnode              List nodes<br />
  lsfence             List fence devices<br />
  addfence &lt;fencedev&gt; Add a new fence device<br />
  delfence &lt;fencedev&gt; Delete a fence device<br />
  create              Create a skeleton config file<br />
  addnodeids          Assign node ID numbers to all nodes<br />
 </p></blockquote>
<h3>相关文章</h3>
<ul class="related_post">
<li>2009年09月21日 -- <a href="http://www.realqi.cn/2009/09/redhat-cluster-suit-with-gfs-2/" title="REDHAT CLUSTER SUIT WITH GFS">REDHAT CLUSTER SUIT WITH GFS (0)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.realqi.cn/2009/08/centos5-install-gfs/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

