<?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>RHEL &#8211; 编码无悔 /  Intent &amp; Focused</title>
	<atom:link href="https://www.codelast.com/tag/rhel/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.codelast.com</link>
	<description>最优化之路</description>
	<lastBuildDate>Sun, 03 May 2020 12:50:34 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>[原创] log4cxx在Linux下的安装、使用</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b-log4cxx%e5%9c%a8linux%e4%b8%8b%e7%9a%84%e5%ae%89%e8%a3%85%e3%80%81%e4%bd%bf%e7%94%a8/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b-log4cxx%e5%9c%a8linux%e4%b8%8b%e7%9a%84%e5%ae%89%e8%a3%85%e3%80%81%e4%bd%bf%e7%94%a8/#comments</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Tue, 09 Aug 2011 06:26:05 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[-lexpat]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[apr]]></category>
		<category><![CDATA[apr-util]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[http://logging.apache.org/log4cxx/]]></category>
		<category><![CDATA[log4c]]></category>
		<category><![CDATA[log4cxx]]></category>
		<category><![CDATA[log4j]]></category>
		<category><![CDATA[properties文件]]></category>
		<category><![CDATA[RedHat]]></category>
		<category><![CDATA[RHEL]]></category>
		<category><![CDATA[undefined reference]]></category>
		<category><![CDATA[使用]]></category>
		<category><![CDATA[安装]]></category>
		<category><![CDATA[格式]]></category>
		<category><![CDATA[编译]]></category>
		<category><![CDATA[配置文件]]></category>
		<category><![CDATA[问题]]></category>
		<guid isPermaLink="false">http://www.codelast.com/?p=3211</guid>

					<description><![CDATA[<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#000;">简单地说，log4cxx就是一个记录日志的C++库（程序运行的时候要保存一些日志到文件，以供将来查看），它是从著名的Java日志库log4j移植而来的，并且它是Apache的一个项目，质量有保证，不用犹豫了，就用它吧！</span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#000;">补一句：Apache声称log4cxx的速度快、灵活性好，但是，速度快是第一位的，灵活性是第二位的（&#34;<span style="color:#800080;">Log4cxx claims to be fast and flexible: speed first, flexibility second.</span>&#34;），所以，担心日志记录性能的同学更可以选择log4cxx啦。</span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#000;">但是，这玩意的安装、编译稍微有点麻烦，如果遇到了问题，没耐心的人可能就没兴趣折腾了，我在这里把自己遇到的问题记一下。</span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#000;">系统环境：RHEL 5.3，64位</span></span></span></p>
<p>
	&#160;</p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span id="more-3211"></span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#000;">首先去log4cxx的官方网站下载源码安装包：<a href="http://logging.apache.org/log4cxx/" target="_blank" rel="noopener noreferrer">http://logging.apache.org/log4cxx/</a>，点击左边的&#8220;Download&#8221;进入下载页面，当前（2011年8月9日）的最新版本是0.10.0，你可以下载 .tar.gz 压缩包，解压出来即可。</span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#000;">然后就可以直接configure，make，make install了吗？不行，因为log4cxx官方提供的源码安装包不是一个all-in-one的包，它还依赖于Apache的另外两个库：Apache Portable Runtime（APR）和Apache Portable Runtime Utility（APR-Util），你可以在这个链接找到它们：<a href="http://apr.apache.org/" target="_blank" rel="noopener noreferrer">http://apr.apache.org/</a>。</span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#000;">（1）安装</span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#000;">安装顺序不能变。首先要安装APR，下载到源码安装包后，解压出来，然后：</span></span></span></p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
./configure --prefix=/usr/local/apr
make
make install
</pre>
<p><span style="font-size: 14px; ">这里把APR安装到了 /usr/local/apr 目录下，注意，千万不要直接./configure，因为那样会把APR的文件安装到若干目录下，非常不利于维护。</span>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b-log4cxx%e5%9c%a8linux%e4%b8%8b%e7%9a%84%e5%ae%89%e8%a3%85%e3%80%81%e4%bd%bf%e7%94%a8/" class="read-more">Read More </a></p>]]></description>
										<content:encoded><![CDATA[<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#000;">简单地说，log4cxx就是一个记录日志的C++库（程序运行的时候要保存一些日志到文件，以供将来查看），它是从著名的Java日志库log4j移植而来的，并且它是Apache的一个项目，质量有保证，不用犹豫了，就用它吧！</span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#000;">补一句：Apache声称log4cxx的速度快、灵活性好，但是，速度快是第一位的，灵活性是第二位的（&quot;<span style="color:#800080;">Log4cxx claims to be fast and flexible: speed first, flexibility second.</span>&quot;），所以，担心日志记录性能的同学更可以选择log4cxx啦。</span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#000;">但是，这玩意的安装、编译稍微有点麻烦，如果遇到了问题，没耐心的人可能就没兴趣折腾了，我在这里把自己遇到的问题记一下。</span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#000;">系统环境：RHEL 5.3，64位</span></span></span></p>
<p>
	&nbsp;</p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span id="more-3211"></span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#000;">首先去log4cxx的官方网站下载源码安装包：<a href="http://logging.apache.org/log4cxx/" target="_blank" rel="noopener noreferrer">http://logging.apache.org/log4cxx/</a>，点击左边的&ldquo;Download&rdquo;进入下载页面，当前（2011年8月9日）的最新版本是0.10.0，你可以下载 .tar.gz 压缩包，解压出来即可。</span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#000;">然后就可以直接configure，make，make install了吗？不行，因为log4cxx官方提供的源码安装包不是一个all-in-one的包，它还依赖于Apache的另外两个库：Apache Portable Runtime（APR）和Apache Portable Runtime Utility（APR-Util），你可以在这个链接找到它们：<a href="http://apr.apache.org/" target="_blank" rel="noopener noreferrer">http://apr.apache.org/</a>。</span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#000;">（1）安装</span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#000;">安装顺序不能变。首先要安装APR，下载到源码安装包后，解压出来，然后：</span></span></span></p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
./configure --prefix=/usr/local/apr
make
make install
</pre>
<p><span style="font-size: 14px; ">这里把APR安装到了 /usr/local/apr 目录下，注意，千万不要直接./configure，因为那样会把APR的文件安装到若干目录下，非常不利于维护。</span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#000;">再安装APR-Util，和上面一样，解压出来源码安装包，然后：</span></span></span></p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make
make install
</pre>
<p><span style="font-size: 14px; ">这里，通过&nbsp;--with-apr 参数指定了前一步安装的APR的目录，同时也将APR-Util的安装目录设置在了/usr/local/apr-util 目录下。</span></p>
<p style="display: inline !important; font-size: 14px;">
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><font class="Apple-style-span" color="#000000">最后，就是安装log4cxx了，但是在安装之前，还要再注意一点：configure的时候要指定APR和APR-Util的安装路径：</font></span></span></p>
<p></p>
<pre class="brush:shell;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
./configure --prefix=/usr/local/log4cxx --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
mv libtool libtool.bak
ln -s /usr/bin/libtool libtool
make 
make install
</pre>
<p><span style="font-size: 14px; ">注意，中间有两条匪夷所思的命令（mv 和 ln -s），如果不执行的话，会报错（我不太记得是在configure的时候还是make的时候报的错了）：</span></p>
<blockquote>
<p>
		<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#00f;"><font class="Apple-style-span">/usr/lib/libexpat.so: could not read symbols: File in wrong format</font><br />
		</span></span></span></p>
</blockquote>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#000;"><font class="Apple-style-span">这些问题的解决办法是从网上搜来的，官方的指南做得不给力啊。</font></span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#000;"><font class="Apple-style-span">这样就把log4cxx安装上了，然后你需要将log4cxx整合进你的程序中，我是把 log4cxx、APR、APR-Util 的三个静态库文件全部放置到我的工程目录下的某个子目录下，然后在Makefile中指定从这个目录下去寻找库文件。三个静态库名如下：liblog4cxx.a，libapr-1.a，libaprutil-1.a。</font></span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#000;"><font class="Apple-style-span">此外，我还将 log4cxx、APR、APR-Util 的所有头文件（.h）放置到了工程目录下。并在自己的程序中include工程目录下的这些文件。</font></span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#000;"><font class="Apple-style-span">然后就是在Makefile中添加上与log4cxx相关的一切东西，包括头文件路径，库文件路径等。如果你编译的时候看到与log4cxx相关的&ldquo;undefined reference ...&rdquo;的错误，那么肯定是没有找到相关的库文件或头文件，这里需要提醒你的是要添加的几个库文件参数：-llog4cxx，-lapr-1，-laprutil-1。</font></span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#000;">你把上面的步骤都做好了，这个时候，你再编译你的程序，可能又会遇到以下错误（好吧，的确有点折磨人）：</span></span></span></p>
<p style="display: inline !important; font-size: 14px;">
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#00f;"><font class="Apple-style-span">./lib/log4cxx/libaprutil-1.a(apr_xml.o): In function `apr_xml_parser_geterror&#39;:</font></span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#00f;"><font class="Apple-style-span">/home/log4cxx/apr-util-1.3.12/xml/apr_xml.c:478: undefined reference to `XML_ErrorString&#39;</font></span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#00f;"><font class="Apple-style-span">./lib/log4cxx/libaprutil-1.a(apr_xml.o): In function `do_parse&#39;:</font></span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#00f;"><font class="Apple-style-span">/home/log4cxx/apr-util-1.3.12/xml/apr_xml.c:418: undefined reference to `XML_Parse&#39;</font></span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#00f;"><font class="Apple-style-span">/home/log4cxx/apr-util-1.3.12/xml/apr_xml.c:422: undefined reference to `XML_GetErrorCode&#39;</font></span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#00f;"><font class="Apple-style-span">./lib/log4cxx/libaprutil-1.a(apr_xml.o): In function `cleanup_parser&#39;:</font></span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#00f;"><font class="Apple-style-span">/home/log4cxx/apr-util-1.3.12/xml/apr_xml.c:344: undefined reference to `XML_ParserFree&#39;</font></span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#00f;"><font class="Apple-style-span">./lib/log4cxx/libaprutil-1.a(apr_xml.o): In function `apr_xml_parser_create&#39;:</font></span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#00f;"><font class="Apple-style-span">/home/log4cxx/apr-util-1.3.12/xml/apr_xml.c:381: undefined reference to `XML_ParserCreate&#39;</font></span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#00f;"><font class="Apple-style-span">/home/log4cxx/apr-util-1.3.12/xml/apr_xml.c:390: undefined reference to `XML_SetUserData&#39;</font></span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#00f;"><font class="Apple-style-span">/home/log4cxx/apr-util-1.3.12/xml/apr_xml.c:391: undefined reference to `XML_SetElementHandler&#39;</font></span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#00f;"><font class="Apple-style-span">/home/log4cxx/apr-util-1.3.12/xml/apr_xml.c:392: undefined reference to `XML_SetCharacterDataHandler&#39;</font></span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#00f;"><font class="Apple-style-span">/home/log4cxx/apr-util-1.3.12/xml/apr_xml.c:404: undefined reference to `XML_SetDefaultHandler&#39;</font></span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#00f;"><font class="Apple-style-span">collect2: ld returned 1 exit status</font></span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#00f;"><font class="Apple-style-span">make: *** [cpsAPI] Error 1</font><br />
	</span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#000;"><font class="Apple-style-span">这些乱七八糟的东西是怎么回事？据网上的一些文章说，这是 libaprutil 的一个bug，它不会自动链接到它的依赖项，从而导致了那些错误。要解决这个问题，你在编译的时候添加 <span style="color:#f00;">-lexpat</span> 参数即可&mdash;&mdash;无论你是在Makefile中，还是在命令行直接用g++命令编译程序，都必须要带上这个参数，否则就会得到上面的那一堆错误（真让人恼火啊）。</font></span></span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#000;"><font class="Apple-style-span">这样，总算全部搞定了，程序可以编译通过了，下面，就是如何使用log4cxx来写日志的问题了，简单地说一下。在你需要写日志的类的文件中（例如MyClass.cpp），include两个log4cxx头文件：<span style="color:#00f;">log4cxx.h</span>和<span style="color:#00f;">propertyconfigurator.h</span>，然后在类的外部添加：</font></span></span></span></p>
<pre class="brush:cpp;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
static log4cxx::LoggerPtr logger(log4cxx::Logger::getLogger(&quot;MyClass.cpp&quot;));
</pre>
<p><span style="font-size: 14px; ">然后在需要写日志之前，先加载log4cxx的配置文件（其实也可以不使用配置文件的，这里假设你要使用自定义的配置文件）：</span></p>
<pre class="brush:cpp;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
log4cxx::PropertyConfigurator::configure(&quot;./log4cxx.properties&quot;);
</pre>
<p><span style="font-size: 14px; "><span style="font-size:14px;"><span style="font-family:微软雅黑;"><font class="Apple-style-span">这里指定了log4cxx.properties文件作为log4cxx的配置文件（文件名不一定是要叫log4cxx.properties），</font></span></span> </span></p>
<p style="display: inline !important; ">
	<span style="font-size: 14px; "><span style="font-size:14px;"><font class="Apple-style-span">在这个文件中定义了各种参数，例如日志文件会写到哪里去，日志的格式等等。具体的格式可以很复杂、功能很强大，这里无法给出一个详细的说明，后面会给出一个简单的文件示例。</font></span></span></p>
<p>
	<span style="font-size: 14px; "><span style="font-size:14px;"><span style="font-family:微软雅黑;"><span style="color:#000;"><font class="Apple-style-span">然后就可以写日志了，例如：</font></span></span></span></span></p>
<p></p>
<pre class="brush:cpp;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
LOG4CXX_INFO(logger, &quot;Test info message.&quot;);
LOG4CXX_ERROR(logger, &quot;Test error message.&quot;);
</pre>
<p><span style="font-size: 14px; color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" style="font-size: 14px; " target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a></p>
<p style="display: inline !important; ">
	<span style="font-size: 14px; "><span style="font-size:14px;"><span style="font-family:微软雅黑;"><font class="Apple-style-span">运行程序，看看日志是否写进去了？写进去的话就说明成功了。</font></span></span></span></p>
<p style="display: inline !important; ">
	<span style="font-size: 14px; "><span style="font-size:14px;"><span style="font-family:微软雅黑;"><font class="Apple-style-span">上面所说的log4cxx.properties文件，给一个例子如下：</font></span></span></span></p>
<p></p>
<pre class="brush:plain;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;">
log4j.rootLogger=debug, R
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
# Pattern to output the caller&#39;s file name and line number.
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %p (%F:%L) %c - %m%n
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=./app.log
log4j.appender.R.MaxFileSize=200KB
# Keep one backup file
log4j.appender.R.MaxBackupIndex=10
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %p (%F:%L) %c - %m%n
</pre>
<p><span style="font-size: 14px; ">更多log4cxx的详细用法，可以参考log4cxx的一些官方例子：</span><a href="http://logging.apache.org/log4cxx/index.html" style="font-size: 14px; " target="_blank" rel="noopener noreferrer">http://logging.apache.org/log4cxx/index.html</a><br />
<span style="font-size: 14px; color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" style="font-size: 14px; " target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a><br />
<span style="font-size: 14px; ">附：【使用log4cxx遇到的一些问题记录】<br />
（1）<span style="color:#0000ff;">IO Exception : status code =28</span><br />
这个错误可能是由于磁盘空间满了造成的，log4cxx无法将日志写入磁盘上，请看<a href="http://www.mail-archive.com/log4cxx-user@logging.apache.org/msg02811.html" target="_blank" rel="noopener noreferrer">这个链接</a>。</span></p>
<p><span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;版权声明&nbsp;<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;<br />
转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong style="font-size: 16px;"><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&nbsp;<br />
感谢关注我的微信公众号（微信扫一扫）：</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
	<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="width: 200px; height: 200px;" /></p>

			<!--[syntaxhighlighter]-->
			<!--代码高亮，请勿编辑-->
			<script type="text/javascript" src="https://www.codelast.com/wp-content/plugins/ck-and-syntaxhighlighter/syntaxhighlighter/scripts/shCore.js"></script><script type="text/javascript" src="https://www.codelast.com/wp-content/plugins/ck-and-syntaxhighlighter/syntaxhighlighter/scripts/shBrushShell.js"></script>
<script type="text/javascript" src="https://www.codelast.com/wp-content/plugins/ck-and-syntaxhighlighter/syntaxhighlighter/scripts/shBrushCpp.js"></script>
<script type="text/javascript" src="https://www.codelast.com/wp-content/plugins/ck-and-syntaxhighlighter/syntaxhighlighter/scripts/shBrushPlain.js"></script>

			<link type="text/css" rel="stylesheet" href="https://www.codelast.com/wp-content/plugins/ck-and-syntaxhighlighter/syntaxhighlighter/styles/shCoreCk.css" />
			<link type="text/css" rel="stylesheet" href="https://www.codelast.com/wp-content/plugins/ck-and-syntaxhighlighter/syntaxhighlighter/styles/shThemeCk.css" />
			<script type="text/javascript">
			SyntaxHighlighter.defaults['class-name']	= '';
			SyntaxHighlighter.defaults['smart-tabs']	= true;
			SyntaxHighlighter.defaults['tab-size']		= 2;
			SyntaxHighlighter.defaults['gutter']		= true;
			SyntaxHighlighter.defaults['quick-code']	= true;
			SyntaxHighlighter.defaults['collapse'] 		= false;
			SyntaxHighlighter.defaults['auto-links']	= true;
			SyntaxHighlighter.defaults['toolbar']		= true;
			SyntaxHighlighter.all();
			</script>
			<!--[/syntaxhighlighter]-->]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9b-log4cxx%e5%9c%a8linux%e4%b8%8b%e7%9a%84%e5%ae%89%e8%a3%85%e3%80%81%e4%bd%bf%e7%94%a8/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
		<item>
		<title>[原创]安装RHEL 5.3时加载自定义的Raid卡驱动</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b%e9%80%9a%e8%bf%87%e5%8a%a0%e8%bd%bd%e8%87%aa%e5%ae%9a%e4%b9%89%e7%9a%84raid%e5%8d%a1%e9%a9%b1%e5%8a%a8%e6%9d%a5%e5%ae%89%e8%a3%85rhel-5-3/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b%e9%80%9a%e8%bf%87%e5%8a%a0%e8%bd%bd%e8%87%aa%e5%ae%9a%e4%b9%89%e7%9a%84raid%e5%8d%a1%e9%a9%b1%e5%8a%a8%e6%9d%a5%e5%ae%89%e8%a3%85rhel-5-3/#respond</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Mon, 07 Mar 2011 13:30:33 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[dd]]></category>
		<category><![CDATA[Raid]]></category>
		<category><![CDATA[RedHat]]></category>
		<category><![CDATA[RHEL]]></category>
		<category><![CDATA[U盘]]></category>
		<category><![CDATA[加载]]></category>
		<category><![CDATA[安装]]></category>
		<category><![CDATA[驱动]]></category>
		<guid isPermaLink="false">http://www.codelast.com/?p=1341</guid>

					<description><![CDATA[<p>
	<span style="font-family:微软雅黑;"><span style="color:#000;"><span style="font-size:14px;">一台装有Raid卡的服务器要安装RHEL 5.3，而RHEL 5.3并不自带该服务器的Raid卡驱动，于是，在图形化界面的安装过程中，当要选择磁盘空间分配的时候，找不到磁盘。于是可知，应该是RHEL 5.3没有自带这块Raid卡的驱动，所以要在安装过程中加载它。</span></span></span></p>
<p>
	<span style="font-family:微软雅黑;"><span style="color:#000;"><span id="more-1341"></span></span></span></p>
<p>
	<span style="font-family:微软雅黑;"><span style="color:#000;"><span style="font-size:14px;">首先，你要从网上下载到你所使用的Raid卡驱动，一般是后缀名为&#8220;.dd&#8221;的文件。然后，在安装过程中要加载它，所以我们必须有一个额外的存储设备来保存它。现在估计已经很难见到软驱这种东西了吧，所以当然用U盘来保存。但是，无论你把U盘做成FAT32，NTFS或ext3等格式，再把驱动文件保存进去，都没有用，因为你在还没有安装RHEL的时候，是无法识别这些格式的设备的，因此，你要把U盘做成&#8220;raw设备&#8221;，并把你的驱动文件写进去。这样，在安装RHEL的时候，就可以顺利读出它了。</span></span></span></p>
<p>
	<span style="font-family:微软雅黑;"><span style="color:#000;"><span style="font-size:14px;">在Linux下，很容易做出raw设备，但是在Windows下，就稍微有点麻烦。你可以使用这个软件来完成这个工作：<a href="http://www.chrysocome.net/dd" target="_blank" rel="noopener noreferrer">http://www.chrysocome.net/dd</a></span></span></span></p>
<p>
	<span style="font-family:微软雅黑;"><span style="color:#000;"><span style="font-size:14px;">下载回来这个软件，解压出来得到dd.exe，它没有图形界面，因此我们在&#8220;开始&#8221;&#8594;&#8220;运行&#8221;&#8594;&#8220;cmd&#8221;命令行下使用它。</span></span></span></p>
<p>
	<span style="color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a></p>
<p>
	<span style="font-family:微软雅黑;"><span style="color:#000;"><span style="font-size:14px;"><font class="Apple-style-span">具体的制作方法这里就不说明了，网上有很多这种类型的文章。由于我遇到的Raid卡的RHEL 5.3的驱动程序提供方使用相当人性化的方式来发布Raid驱动（解压出来是一个dd.iso文件），使得我只需要把驱动镜像文件（dd.iso）制作到U盘中，就可以在安装RHEL的时候加载了。这里需要说明的一点是：可以使用UltraISO软件来将这个ISO文件制作到U盘中，但是，你要注意的是，在制作的时候，你的dd.iso应该是完整地处于你的&#8220;驱动U盘&#8221;的根目录下，而不是将dd.iso里的内容拷出来再制作到&#8220;驱动U盘&#8221;中，如下图所示：</font></span></span></span></p>
<p>
	<span style="font-family:微软雅黑;"><span style="color:#000;"><span style="font-size:14px;"><img fetchpriority="high" decoding="async" alt="dd.iso" height="548" src="http://www.codelast.com/wp-content/uploads/2011/03/driver_iso.png" width="785" /></span></span></span></p>
<p>
	<span style="color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a><br />
	<span style="font-size: 14px; ">然后，插入你的U盘，再点击菜单&#8220;启动&#8221;&#8594;&#8220;写入硬盘映像&#8221;，&#8220;写入方式&#8221;选择&#8220;USB-HDD+&#8221;，开始制作驱动U盘。</span></p>
<p>
	<span style="font-family:微软雅黑;"><span style="color:#000;"><span style="font-size:14px;">制作好之后，这个U盘在Windows下便成为了一种不可识别的格式，双击它的话会提示该设备未格式化，不用理它，直接拿到服务器上去安装系统用。</span></span></span></p>
<p>
	<span style="font-family:微软雅黑;"><span style="color:#000;"><span style="font-size:14px;">在RHEL安装过程中，刚看到安装界面，让你选择安装选项的时候，命令行提示符为&#8220;boot:&#8221;，这时，你是可以输入命令的，由于我们必须先加载驱动，因此在这里我们就要输入命令：</span></span></span></p>
<p>
	<span style="font-family:微软雅黑;"><span style="color:#00f;"><span style="font-size:14px;">linux dd</span></span></span></p>
<p>
	<span style="font-family:微软雅黑;"><span style="color:#000;"><span style="font-size:14px;">然后到下一步的时候，会让你选择U盘，以及相应的驱动程序。如果U盘选对了的话，就会看到其中的dd.iso文件了，然后你再继续做下去，就会看到加载一些驱动的提示了。再往后，就是安装RHEL的过程了，这里不用说你也肯定懂的。由于加载了Raid驱动，你在分区的时候就能看到磁盘了，这就说明驱动是正确的（如果还是看不到，你要考虑驱动版本是否正确了）。</span></span></span></p>
<p>
	<br />
	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
	<span style="color: rgb(255, 0, 0);">➤➤</span>&#160;版权声明&#160;<span style="color: rgb(255, 0, 0);">➤➤</span>&#160;<br />
	转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong style="font-size: 16px;"><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&#160;<br />
	感谢关注我的微信公众号（微信扫一扫）：</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
	<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="width: 200px; height: 200px;" />&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b%e9%80%9a%e8%bf%87%e5%8a%a0%e8%bd%bd%e8%87%aa%e5%ae%9a%e4%b9%89%e7%9a%84raid%e5%8d%a1%e9%a9%b1%e5%8a%a8%e6%9d%a5%e5%ae%89%e8%a3%85rhel-5-3/" class="read-more">Read More </a></p>]]></description>
										<content:encoded><![CDATA[<p>
	<span style="font-family:微软雅黑;"><span style="color:#000;"><span style="font-size:14px;">一台装有Raid卡的服务器要安装RHEL 5.3，而RHEL 5.3并不自带该服务器的Raid卡驱动，于是，在图形化界面的安装过程中，当要选择磁盘空间分配的时候，找不到磁盘。于是可知，应该是RHEL 5.3没有自带这块Raid卡的驱动，所以要在安装过程中加载它。</span></span></span></p>
<p>
	<span style="font-family:微软雅黑;"><span style="color:#000;"><span id="more-1341"></span></span></span></p>
<p>
	<span style="font-family:微软雅黑;"><span style="color:#000;"><span style="font-size:14px;">首先，你要从网上下载到你所使用的Raid卡驱动，一般是后缀名为&ldquo;.dd&rdquo;的文件。然后，在安装过程中要加载它，所以我们必须有一个额外的存储设备来保存它。现在估计已经很难见到软驱这种东西了吧，所以当然用U盘来保存。但是，无论你把U盘做成FAT32，NTFS或ext3等格式，再把驱动文件保存进去，都没有用，因为你在还没有安装RHEL的时候，是无法识别这些格式的设备的，因此，你要把U盘做成&ldquo;raw设备&rdquo;，并把你的驱动文件写进去。这样，在安装RHEL的时候，就可以顺利读出它了。</span></span></span></p>
<p>
	<span style="font-family:微软雅黑;"><span style="color:#000;"><span style="font-size:14px;">在Linux下，很容易做出raw设备，但是在Windows下，就稍微有点麻烦。你可以使用这个软件来完成这个工作：<a href="http://www.chrysocome.net/dd" target="_blank" rel="noopener noreferrer">http://www.chrysocome.net/dd</a></span></span></span></p>
<p>
	<span style="font-family:微软雅黑;"><span style="color:#000;"><span style="font-size:14px;">下载回来这个软件，解压出来得到dd.exe，它没有图形界面，因此我们在&ldquo;开始&rdquo;&rarr;&ldquo;运行&rdquo;&rarr;&ldquo;cmd&rdquo;命令行下使用它。</span></span></span></p>
<p>
	<span style="color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a></p>
<p>
	<span style="font-family:微软雅黑;"><span style="color:#000;"><span style="font-size:14px;"><font class="Apple-style-span">具体的制作方法这里就不说明了，网上有很多这种类型的文章。由于我遇到的Raid卡的RHEL 5.3的驱动程序提供方使用相当人性化的方式来发布Raid驱动（解压出来是一个dd.iso文件），使得我只需要把驱动镜像文件（dd.iso）制作到U盘中，就可以在安装RHEL的时候加载了。这里需要说明的一点是：可以使用UltraISO软件来将这个ISO文件制作到U盘中，但是，你要注意的是，在制作的时候，你的dd.iso应该是完整地处于你的&ldquo;驱动U盘&rdquo;的根目录下，而不是将dd.iso里的内容拷出来再制作到&ldquo;驱动U盘&rdquo;中，如下图所示：</font></span></span></span></p>
<p>
	<span style="font-family:微软雅黑;"><span style="color:#000;"><span style="font-size:14px;"><img decoding="async" alt="dd.iso" height="548" src="http://www.codelast.com/wp-content/uploads/2011/03/driver_iso.png" width="785" /></span></span></span></p>
<p>
	<span style="color: rgb(255, 255, 255); ">文章来源：</span><a href="http://www.codelast.com/" target="_blank" rel="noopener noreferrer"><span style="color: rgb(255, 255, 255); ">http://www.codelast.com/</span></a><br />
	<span style="font-size: 14px; ">然后，插入你的U盘，再点击菜单&ldquo;启动&rdquo;&rarr;&ldquo;写入硬盘映像&rdquo;，&ldquo;写入方式&rdquo;选择&ldquo;USB-HDD+&rdquo;，开始制作驱动U盘。</span></p>
<p>
	<span style="font-family:微软雅黑;"><span style="color:#000;"><span style="font-size:14px;">制作好之后，这个U盘在Windows下便成为了一种不可识别的格式，双击它的话会提示该设备未格式化，不用理它，直接拿到服务器上去安装系统用。</span></span></span></p>
<p>
	<span style="font-family:微软雅黑;"><span style="color:#000;"><span style="font-size:14px;">在RHEL安装过程中，刚看到安装界面，让你选择安装选项的时候，命令行提示符为&ldquo;boot:&rdquo;，这时，你是可以输入命令的，由于我们必须先加载驱动，因此在这里我们就要输入命令：</span></span></span></p>
<p>
	<span style="font-family:微软雅黑;"><span style="color:#00f;"><span style="font-size:14px;">linux dd</span></span></span></p>
<p>
	<span style="font-family:微软雅黑;"><span style="color:#000;"><span style="font-size:14px;">然后到下一步的时候，会让你选择U盘，以及相应的驱动程序。如果U盘选对了的话，就会看到其中的dd.iso文件了，然后你再继续做下去，就会看到加载一些驱动的提示了。再往后，就是安装RHEL的过程了，这里不用说你也肯定懂的。由于加载了Raid驱动，你在分区的时候就能看到磁盘了，这就说明驱动是正确的（如果还是看不到，你要考虑驱动版本是否正确了）。</span></span></span></p>
<p>
	<br />
	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
	<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;版权声明&nbsp;<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;<br />
	转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong style="font-size: 16px;"><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&nbsp;<br />
	感谢关注我的微信公众号（微信扫一扫）：</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
	<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="width: 200px; height: 200px;" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9b%e9%80%9a%e8%bf%87%e5%8a%a0%e8%bd%bd%e8%87%aa%e5%ae%9a%e4%b9%89%e7%9a%84raid%e5%8d%a1%e9%a9%b1%e5%8a%a8%e6%9d%a5%e5%ae%89%e8%a3%85rhel-5-3/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[原创]xfs文件系统在RHEL 5.3下的安装及配置 &#038; NFS挂载出错的解决办法</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9bxfs%e6%96%87%e4%bb%b6%e7%b3%bb%e7%bb%9f%e5%9c%a8rhel%e4%b8%8b%e7%9a%84%e5%ae%89%e8%a3%85%e5%8f%8a%e9%85%8d%e7%bd%ae/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9bxfs%e6%96%87%e4%bb%b6%e7%b3%bb%e7%bb%9f%e5%9c%a8rhel%e4%b8%8b%e7%9a%84%e5%ae%89%e8%a3%85%e5%8f%8a%e9%85%8d%e7%bd%ae/#respond</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Thu, 03 Mar 2011 10:46:03 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[2TB]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[file system]]></category>
		<category><![CDATA[gpt]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[MBR]]></category>
		<category><![CDATA[RedHat]]></category>
		<category><![CDATA[RHEL]]></category>
		<category><![CDATA[xfs]]></category>
		<category><![CDATA[分区表]]></category>
		<category><![CDATA[安装]]></category>
		<category><![CDATA[文件系统]]></category>
		<category><![CDATA[磁盘]]></category>
		<category><![CDATA[配置]]></category>
		<category><![CDATA[限制]]></category>
		<guid isPermaLink="false">http://www.codelast.com/?p=1320</guid>

					<description><![CDATA[<p>
	<span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;">要在RHEL里的一个分区上使用xfs文件系统，不像Ubuntu那么简单。此处以RHEL 5.3为例，说明如何将一个分区格式化为xfs文件系统，并开机自动挂载。</span></span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;">首先，从安装RHEL 5.3说起。它默认是不支持xfs的，你无法在安装过程中指定一个分区使用xfs格式。因此，我选择了将此分区做成ext3的方法，待完全安装好系统之后再在命令行下格式化为xfs。</span></span></p>
<p>
<span id="more-1320"></span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;">其次，安装好RHEL 5.3后，你要安装xfs相关的软件。我不得不说，<a href="http://xfs.org/index.php/Main_Page" target="_blank" rel="noopener noreferrer">xfs官方主页</a>做得实在太烂了，连个快速让人下载到所需软件的地方都没有，这货还让人用git检出其源码来安装，我还得为了这玩意先装个git，然后再用龟速网络来检出源码，费劲吗？一句话形容：BT到极点。</span></span></p>
<p>
	<span style="color: #ffffff; font-size: 14px;">文章来源：http://www.codelast.com/</span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;">于是我转而寻找可用的rpm包，还真是难找。我要是没记错的话，最后是在这个网站下载到的rpm包：<span style="color: #800080;">http://rpm.pbone.net/</span></span></span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;">下载到的包名为：<span style="color: #008000;">kmod-xfs-0.4-2.x86_64.rpm</span> 和<span style="color: #008000;"> xfsprogs-2.9.4-1.el5.centos.x86_64.rpm</span></span></span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;">依次安装两个包，很顺利就装上了。</span></span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;">然后你要经历以下步骤，以完成使一个xfs分区可正常使用的任务：</span></span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;">加载xfs模块：</span></span></p>
<p>
	<span style="color: #00f;"><span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;"><span style="line-height: 19px;">modprobe xfs</span></span></span></span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;"><span style="color: #333333; line-height: 19px;">检查加载结果：</span></span></span></p>
<p>
	<span style="color: #00f;"><span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;"><span style="line-height: 19px;">lsmod &#124; grep xfs</span></span></span></span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;"><span style="color: #333333; line-height: 19px;">输出结果形如：</span></span></span></p>
<p>
	<span style="color: #00f;"><span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;"><span style="line-height: 19px;">xfs &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; 514248 &#160;1</span></span></span><br />
	</span></p>
<p>
	<span style="color: #ffffff; font-size: 14px;">文章来源：http://www.codelast.com/</span></p>
<p>
	<span style="font-family: arial,helvetica,sans-serif;"><span style="font-size: 14px;"><span style="color: #000;"><span>在将分区格式化之前，我们当然要先在物理磁盘上创建分区。如果你的一个磁盘〉2TB，你要在它上面创建出一个〉2TB的分区的话，你是无法使用MBR（master boot record）形式的分区表的，因为MBR形式的分区表无法支持一个〉2TB的分区。你可以使用GPT（Guid Partition table）来突破这个限制。<a href="http://plone.lucidsolutions.co.nz/linux/io/using-gnu-parted-to-create-a-gpt-for-a-device-2tb" target="_blank" rel="noopener noreferrer">这个</a>链接会对你有所帮助。</span></span></span></span></p>
<p>
	<span style="font-family: arial,helvetica,sans-serif;"><span style="font-size: 14px;"><span style="color: #000;"><span>通常，我们是使用 </span><span style="line-height: 19px;">fdisk 命令来分区的，但是 fdisk 命令无法支持〉2TB的分区操作&#8212;&#8212;你可以用<span style="color: #00f;"> fdisk -l </span>命令查看，会得到类似于下面的提示：</span></span></span></span></p>
<p>
	<span style="color: #800080;"><span style="font-family: arial, helvetica, sans-serif;"><span style="font-size: 14px; line-height: 19px;">WARNING: The size of this disk is XXX TB (XXXXXXXXXXXXXX bytes).</span></span></span>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9bxfs%e6%96%87%e4%bb%b6%e7%b3%bb%e7%bb%9f%e5%9c%a8rhel%e4%b8%8b%e7%9a%84%e5%ae%89%e8%a3%85%e5%8f%8a%e9%85%8d%e7%bd%ae/" class="read-more">Read More </a></p>]]></description>
										<content:encoded><![CDATA[<p>
	<span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;">要在RHEL里的一个分区上使用xfs文件系统，不像Ubuntu那么简单。此处以RHEL 5.3为例，说明如何将一个分区格式化为xfs文件系统，并开机自动挂载。</span></span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;">首先，从安装RHEL 5.3说起。它默认是不支持xfs的，你无法在安装过程中指定一个分区使用xfs格式。因此，我选择了将此分区做成ext3的方法，待完全安装好系统之后再在命令行下格式化为xfs。</span></span></p>
<p>
<span id="more-1320"></span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;">其次，安装好RHEL 5.3后，你要安装xfs相关的软件。我不得不说，<a href="http://xfs.org/index.php/Main_Page" target="_blank" rel="noopener noreferrer">xfs官方主页</a>做得实在太烂了，连个快速让人下载到所需软件的地方都没有，这货还让人用git检出其源码来安装，我还得为了这玩意先装个git，然后再用龟速网络来检出源码，费劲吗？一句话形容：BT到极点。</span></span></p>
<p>
	<span style="color: #ffffff; font-size: 14px;">文章来源：http://www.codelast.com/</span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;">于是我转而寻找可用的rpm包，还真是难找。我要是没记错的话，最后是在这个网站下载到的rpm包：<span style="color: #800080;">http://rpm.pbone.net/</span></span></span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;">下载到的包名为：<span style="color: #008000;">kmod-xfs-0.4-2.x86_64.rpm</span> 和<span style="color: #008000;"> xfsprogs-2.9.4-1.el5.centos.x86_64.rpm</span></span></span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;">依次安装两个包，很顺利就装上了。</span></span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;">然后你要经历以下步骤，以完成使一个xfs分区可正常使用的任务：</span></span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;">加载xfs模块：</span></span></p>
<p>
	<span style="color: #00f;"><span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;"><span style="line-height: 19px;">modprobe xfs</span></span></span></span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;"><span style="color: #333333; line-height: 19px;">检查加载结果：</span></span></span></p>
<p>
	<span style="color: #00f;"><span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;"><span style="line-height: 19px;">lsmod | grep xfs</span></span></span></span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;"><span style="color: #333333; line-height: 19px;">输出结果形如：</span></span></span></p>
<p>
	<span style="color: #00f;"><span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;"><span style="line-height: 19px;">xfs &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 514248 &nbsp;1</span></span></span><br />
	</span></p>
<p>
	<span style="color: #ffffff; font-size: 14px;">文章来源：http://www.codelast.com/</span></p>
<p>
	<span style="font-family: arial,helvetica,sans-serif;"><span style="font-size: 14px;"><span style="color: #000;"><span>在将分区格式化之前，我们当然要先在物理磁盘上创建分区。如果你的一个磁盘〉2TB，你要在它上面创建出一个〉2TB的分区的话，你是无法使用MBR（master boot record）形式的分区表的，因为MBR形式的分区表无法支持一个〉2TB的分区。你可以使用GPT（Guid Partition table）来突破这个限制。<a href="http://plone.lucidsolutions.co.nz/linux/io/using-gnu-parted-to-create-a-gpt-for-a-device-2tb" target="_blank" rel="noopener noreferrer">这个</a>链接会对你有所帮助。</span></span></span></span></p>
<p>
	<span style="font-family: arial,helvetica,sans-serif;"><span style="font-size: 14px;"><span style="color: #000;"><span>通常，我们是使用 </span><span style="line-height: 19px;">fdisk 命令来分区的，但是 fdisk 命令无法支持〉2TB的分区操作&mdash;&mdash;你可以用<span style="color: #00f;"> fdisk -l </span>命令查看，会得到类似于下面的提示：</span></span></span></span></p>
<p>
	<span style="color: #800080;"><span style="font-family: arial, helvetica, sans-serif;"><span style="font-size: 14px; line-height: 19px;">WARNING: The size of this disk is XXX TB (XXXXXXXXXXXXXX bytes).</span></span></span></p>
<p>
	<span style="color: #800080;"><span style="font-family: arial, helvetica, sans-serif;"><span style="font-size: 14px; line-height: 19px;">DOS partition table format can not be used on drives for volumes </span></span><span style="font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 19px;">larger than 2.2 TB (2199023255040 bytes). Use parted(1) and GUID </span><span style="font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 19px;">partition table format (GPT).</span></span></p>
<p>
	<span style="font-family: arial,helvetica,sans-serif;"><span style="font-size: 14px;"><span style="color: #000;"><span><span style="line-height: 19px;">很明显，它已经提示你要用GPT了。</span></span></span></span></span></p>
<p>
	<span style="color: #000;"><span style="font-family: arial,helvetica,sans-serif;"><span style="font-size: 14px;">而使用&nbsp;<span style="color: #f00;">parted</span> 工具，则可以创建出〉2TB的分区，方法如下（假设你的磁盘为<span style="color: #00f;"> /dev/sdb</span> ）：</span></span></span></p>
<p>
	<span style="color: #0000ff;"><span style="font-family: arial, helvetica, sans-serif;"><span style="font-size: 14px;">parted /dev/sdb</span></span></span></p>
<p>
	<span style="color: #0000ff;"><span style="font-family: arial, helvetica, sans-serif;"><span style="font-size: 14px;"><span style="color: #000000;">(parted) </span>mklabel gpt</span></span></span></p>
<p>
	<span style="color: #0000ff;"><span style="font-family: arial, helvetica, sans-serif;"><span style="font-size: 14px;"><span style="color: #000000;">(parted)</span> mkpart primary xfs 0 -0</span></span></span></p>
<p>
	<span style="color: #0000ff;"><span style="font-family: arial, helvetica, sans-serif;"><span style="font-size: 14px;"><span style="color: #000000;">(parted)</span> quit</span></span></span></p>
<p>
	&nbsp;</p>
<p>
	&nbsp;</p>
<p>
	<span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;"><span style="color: #333333; line-height: 19px;">下面就到格式化分区了。假设你要格式化为xfs的分区为/dev/sdb1，它是挂载在 /myxfs 目录下的，则：</span></span></span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;"><span style="color: #333333; line-height: 19px;">先格式化xfs分区：</span></span></span></p>
<p>
	<span style="color: #00f;"><span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;"><span style="line-height: 19px;">mkfs.xfs -f /dev/sdb1</span></span></span></span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;"><span style="color: #333333; line-height: 19px;">然后挂载xfs分区：</span></span></span></p>
<p>
	<span style="color: #00f;"><span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;"><span style="line-height: 19px;">mount -t xfs /dev/sdb1 /myxfs/</span></span></span><br />
	</span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;"><span style="color: #333333; line-height: 19px;">然后看看挂载上没有：</span></span></span></p>
<p>
	<span style="color: #00f;"><span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;"><span style="line-height: 19px;">mount</span></span></span><br />
	</span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;"><span style="color: #333333; line-height: 19px;">应该会看到类似于这样的结果：<span style="color: #00f;">/dev/sdb1 on /myxfs type xfs (rw)</span></span></span></span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;"><span style="color: #333333; line-height: 19px;">别以为这样就结束了，你还要在 <span style="color: #008000;">/etc/fstab </span>文件中添加或修改相关的内容，使得开机启动系统后可以自动挂载xfs分区。</span></span></span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;"><span style="color: #333333; line-height: 19px;">我原来这个分区是ext3格式的，因此在 /etc/fstab 文件中有一句残留的语句：</span></span></span></p>
<p>
	<span style="color: #00f;"><span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;"><span style="line-height: 19px;">LABEL=/myxfs &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /myxfs &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ext3 &nbsp; &nbsp;defaults &nbsp; &nbsp; &nbsp; &nbsp;1 2</span></span></span></span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;"><span style="color: #333333; line-height: 19px;">你可能觉得，把 <span style="color: #00f;">ext3</span> 改为 <span style="color: #00f;">xs</span> 再保存文件就解决问题了，你可以试试这样做之后重启，再看看xfs分区是否挂载成功了？没有。为什么？具体原因你们可以看<a href="https://bugzilla.redhat.com/show_bug.cgi?id=122043" target="_blank" rel="noopener noreferrer"><span style="color: #f00;">这个</span></a></span>链接，我在这里只说解决办法：</span></span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;">先设置xfs分区的label（卷标）：</span></span></p>
<p>
	<span style="color: #00f;"><span style="background-color: #fff;"><span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;">xfs_admin -L /myxfs /dev/sdb1</span></span><br />
	</span></span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;">这表示将卷标</span></span><span style="font-family: arial, helvetica, sans-serif; font-size: 14px;">设置</span><span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;">为 </span></span><span style="font-family: arial, helvetica, sans-serif; font-size: 14px;">/myxfs 。</span><span style="font-family: arial, helvetica, sans-serif; font-size: 14px;">然后查看刚设置的xfs分区的卷标：</span></p>
<p>
	<span style="color: #00f;"><span style="font-family: arial, helvetica, sans-serif; font-size: 14px;">xfs_admin -l /dev/sdb1</span><br />
	</span></p>
<p>
	<span style="font-family: arial, helvetica, sans-serif;"><span style="font-size: 14px;">输出结果为刚设置的卷标就对了。</span></span></p>
<p>
	<span style="color: #ffffff; font-size: 14px;">文章来源：http://www.codelast.com/</span></p>
<p>
	<span style="font-size: 14px;"><span style="font-family: arial,helvetica,sans-serif;">然后，修改</span></span><span style="color: #333333; font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 19px;"> </span><span style="color: #333333; font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 19px;"><span style="color: #008000;">/etc/fstab </span></span><span style="color: #333333; font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 19px;">文件，将这一句：</span></p>
<p>
	<span style="color: #0000ff; font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 19px;">LABEL=/myxfs &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /myxfs &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ext3 &nbsp; &nbsp;defaults &nbsp; &nbsp; &nbsp; &nbsp;1 2</span></p>
<p>
	<span style="color: #333333; font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 19px;">改为：</span></p>
<p>
	<span style="color: #0000ff; font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 19px;">LABEL=/myxfs &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /myxfs &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xfs &nbsp; &nbsp;defaults &nbsp; &nbsp; &nbsp; &nbsp;1 2</span></p>
<p>
	<span style="color: #333333; font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 19px;">就搞定了！现在你再重启系统，看看是否成功挂载了xfs分区：</span></p>
<p>
	<span style="color: #00f;"><span style="background-color: #fff;"><span style="font-family: arial,helvetica,sans-serif;"><span style="font-size: 14px;"><span style="line-height: 19px;">df -h; mount;</span></span></span></span></span></p>
<p>
	&nbsp;</p>
<p>
	<span style="color: #ffffff; font-size: 14px;">文章来源：http://www.codelast.com/</span></p>
<p>
	<span style="color: #333333; font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 19px;"><span style="color:#00f;">顺便再记一下NFS挂载中遇到的两个错误的解决办法（与上面的文章没有任何关系）</span>：</span></p>
<p>
	<span style="color: #333333; font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 19px;">假设我们要把远程服务器192.168.22.33的<span style="color: #f00;"> /src</span> 目录挂载到本机上的 <span style="color: #f00;">/dest </span>目录下，则我们的挂载命令为：</span></p>
<p>
	<span style="color: #00f;"><span style="font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 19px;">mount -t nfs 192.168.22.33:/src/ /dest/</span><br />
	</span></p>
<p>
	<span style="color: #333333; font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 19px;">但是你可能会遇到以下错误提示：</span></p>
<p>
	<span style="color: #333333; font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 19px;"><span style="color: #b22222;">错误（1）</span>：</span></p>
<p>
	<span style="color: #800080;"><span style="font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 19px;">mount: mount to NFS server XXX failed: RPC Error: Program not registered</span></span></p>
<p>
	<span style="color: #333333; font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 19px;">解决这个问题，一般来说重启远程服务器上的nfs服务就可以了，在此例中，我在192.168.22.33服务器上执行：</span></p>
<p>
	<span style="color: #00f;"><span style="font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 19px;">service nfs restart</span><br />
	</span></p>
<p>
	<span style="color: #ffffff; font-size: 14px;">文章来源：http://www.codelast.com/</span></p>
<p>
	<span style="color: #333333; font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 19px;"><span style="color: #b22222;">错误（2）</span></span>：<span style="font-family: arial,helvetica,sans-serif;"><span style="font-size: 14px;">再重新挂载，仍然出错，提示为：</span></span></p>
<p>
	<span style="color: #800080;"><span style="font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 19px;">mount: XXX failed, reason given by server: Permission denied</span><br />
	</span></p>
<p>
	<span style="color: #333333; font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 19px;">这个错误是由于你没有在远程服务器上为客户机安装NFS，解决办法是修改远程服务器上的<span style="color: #008000;"> /etc/exports </span>文件（如果你没有改过这个文件的话，文件内容应该是空的），添加类似于下面这一句：</span></p>
<p>
	<span style="color: #00f;"><span style="font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 19px;">/src *(rw,sync,no_root_squash)</span><br />
	</span></p>
<p>
	<span style="color: #333333; font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 19px;">这表示允许任何客户机通过NFS挂载 /src 目录。当然这样不区分IP的设置方式有点危险，你可以修改为其他授权方式（例如 /src 192.168.44.0/24(rw,insecure,anonuid=0,sync,no_wdelay)），具体的写法这里就不详述了。</span></p>
<p>
	<span style="color: #333333; font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 19px;">然后，在修改了/etc/exports文件后，不需要重新激活nfs，只要重新扫描一次/etc/exports文件，并且重新将设定加载即可：</span></p>
<p>
	<span style="color: #00f;"><span style="font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 19px;">exportfs -va</span><br />
	</span></p>
<p>
	<span style="color: #333333; font-family: arial, helvetica, sans-serif; font-size: 14px; line-height: 19px;">此时，你再在客户机上挂载试试看，应该就成功了。注意哟，如果你想开机也能自动mount，那么就需要修改 /etc/fstab 文件啦，这里就不谈了。</p>
<p>	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
	<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;版权声明&nbsp;<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;<br />
	转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong style="font-size: 16px;">codelast.com</strong></span></em></a></u>&nbsp;<br />
	感谢关注我的微信公众号（微信扫一扫）：</span></p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
	<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="width: 200px; height: 200px;" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9bxfs%e6%96%87%e4%bb%b6%e7%b3%bb%e7%bb%9f%e5%9c%a8rhel%e4%b8%8b%e7%9a%84%e5%ae%89%e8%a3%85%e5%8f%8a%e9%85%8d%e7%bd%ae/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[原创] 在RHEL上安装Thrift（支持C++）的若干问题</title>
		<link>https://www.codelast.com/%e5%8e%9f%e5%88%9b%e5%9c%a8rhel%e4%b8%8a%e5%ae%89%e8%a3%85thrift%ef%bc%88%e6%94%af%e6%8c%81c%ef%bc%89%e7%9a%84%e8%8b%a5%e5%b9%b2%e9%97%ae%e9%a2%98/</link>
					<comments>https://www.codelast.com/%e5%8e%9f%e5%88%9b%e5%9c%a8rhel%e4%b8%8a%e5%ae%89%e8%a3%85thrift%ef%bc%88%e6%94%af%e6%8c%81c%ef%bc%89%e7%9a%84%e8%8b%a5%e5%b9%b2%e9%97%ae%e9%a2%98/#comments</comments>
		
		<dc:creator><![CDATA[learnhard]]></dc:creator>
		<pubDate>Wed, 15 Dec 2010 10:10:33 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[Boost]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[Hbase]]></category>
		<category><![CDATA[libevent]]></category>
		<category><![CDATA[libThrift]]></category>
		<category><![CDATA[libThriftnb]]></category>
		<category><![CDATA[Python.h]]></category>
		<category><![CDATA[RedHat]]></category>
		<category><![CDATA[RHEL]]></category>
		<category><![CDATA[Thrift]]></category>
		<category><![CDATA[安装]]></category>
		<guid isPermaLink="false">http://www.codelast.com/?p=918</guid>

					<description><![CDATA[<p>
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">本文针对的读者：要用Thrift开发C++应用程序的人。</span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">环境：</span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">RHEL 5.3（内核2.6.18-128.el5），32位</span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">gcc 4.1.2</span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">Boost 1.35.0</span></span></p>
<p>
<span id="more-918"></span></p>
<p>
	&#160;</p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="color:#f00;">（1）</span>什么是Thrift？</span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">先转一段网上的定义：</span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">Thrift是一个跨语言服务部署框架，最初由Facebook于2007年开发，后于2008年进入Apache孵化器(Apache Incubator)。</span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">类似于SOAP，COM 和CORBA，Thrift通过定义一个中间定义语言和Thrift代码生成工具，生成指定语言的代码。目前，Thrift支持C++,Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, Smalltalk和OCaml的代码生成。</span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">简单分析其机理，Thrift就是实现C/S模式，通过代码生成工具将接口定义文件生成服务器端和客户端代码（可以为不同语言），从而实现服务端和客户端跨语言的支持。</span></span></p>
<div>
	&#160;</div>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;"><span style="color:#f00;">（2）</span>从源码安装Thrift的时候，也像通常的软件安装过程一样，通过configure &#8594; make &#8594; make install 的过程就可以完成。但安装过程比较烦人，我遇到了一个又一个的问题，总的来说还是比较繁琐的，特别记下来：</span></span></p>
<p>
	&#160;</p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">Thrift在configure的时候提示找不到php-config的话，需要手动指定其路径（如果没装PHP则需安装）。</span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">PHP 5.3.4安装的过程中，configure的时候出现error，提示找不到libxml2，于是我安装了libxml2-devel-2.6.26-2.1.2.7.i386.rpm。</span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">你还需要预先安装libevent库，我安装的是libevent-2.0.9-rc版本。</span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><strong style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(46, 46, 46); border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; "><span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; color: rgb(0, 0, 255); "><span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; "><span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; color: rgb(255, 255, 255); font-weight: normal; line-height: 20px; ">文章来源：http://www.codelast.com/</span></span></span></strong></span>&#8230; <a href="https://www.codelast.com/%e5%8e%9f%e5%88%9b%e5%9c%a8rhel%e4%b8%8a%e5%ae%89%e8%a3%85thrift%ef%bc%88%e6%94%af%e6%8c%81c%ef%bc%89%e7%9a%84%e8%8b%a5%e5%b9%b2%e9%97%ae%e9%a2%98/" class="read-more">Read More </a></p>]]></description>
										<content:encoded><![CDATA[<p>
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">本文针对的读者：要用Thrift开发C++应用程序的人。</span></span></p>
<p>
	<span style="font-size:14px;"><span style="font-family:arial,helvetica,sans-serif;">环境：</span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">RHEL 5.3（内核2.6.18-128.el5），32位</span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">gcc 4.1.2</span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">Boost 1.35.0</span></span></p>
<p>
<span id="more-918"></span></p>
<p>
	&nbsp;</p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="color:#f00;">（1）</span>什么是Thrift？</span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">先转一段网上的定义：</span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">Thrift是一个跨语言服务部署框架，最初由Facebook于2007年开发，后于2008年进入Apache孵化器(Apache Incubator)。</span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">类似于SOAP，COM 和CORBA，Thrift通过定义一个中间定义语言和Thrift代码生成工具，生成指定语言的代码。目前，Thrift支持C++,Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, Smalltalk和OCaml的代码生成。</span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">简单分析其机理，Thrift就是实现C/S模式，通过代码生成工具将接口定义文件生成服务器端和客户端代码（可以为不同语言），从而实现服务端和客户端跨语言的支持。</span></span></p>
<div>
	&nbsp;</div>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;"><span style="color:#f00;">（2）</span>从源码安装Thrift的时候，也像通常的软件安装过程一样，通过configure &rarr; make &rarr; make install 的过程就可以完成。但安装过程比较烦人，我遇到了一个又一个的问题，总的来说还是比较繁琐的，特别记下来：</span></span></p>
<p>
	&nbsp;</p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">Thrift在configure的时候提示找不到php-config的话，需要手动指定其路径（如果没装PHP则需安装）。</span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">PHP 5.3.4安装的过程中，configure的时候出现error，提示找不到libxml2，于是我安装了libxml2-devel-2.6.26-2.1.2.7.i386.rpm。</span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">你还需要预先安装libevent库，我安装的是libevent-2.0.9-rc版本。</span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><strong style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(46, 46, 46); border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; "><span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; color: rgb(0, 0, 255); "><span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; "><span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; color: rgb(255, 255, 255); font-weight: normal; line-height: 20px; ">文章来源：http://www.codelast.com/</span></span></span></strong> </span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">如果你没有安装Boost就执行Thrift的configure，则会看到下面的提示：</span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="color:#f00;"><span style="font-size:14px;">Building C++ Library ......... : no</span></span></span></p>
<p>
	&nbsp;</p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">此时，如果你make，也得不到Thrift的C++库。</span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">以默认参数安装了Boost之后（我安装的是1.35.0版本），configure的时候就会看到下面的提示：</span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="color:#f00;"><span style="font-size:14px;">Building C++ Library ......... : yes</span></span></span></p>
<p>
	&nbsp;</p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">然后重新开始make。</span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;"><strong style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(46, 46, 46); border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; "><span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; color: rgb(0, 0, 255); "><span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; "><span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; color: rgb(255, 255, 255); font-weight: normal; line-height: 20px; ">文章来源：http://www.codelast.com/</span></span></span></strong> </span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">到了某一步，如果提示下面的错误：</span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="color:#f00;"><span style="font-size:14px;">src/protocol/fastbinary.c:20:20: error: Python.h: No such file or directory</span></span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="color:#00f;"><span style="font-size:14px;">（中间一堆的错误，此处省略）</span></span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="color:#f00;"><span style="font-size:14px;">error: command &#39;gcc&#39; failed with exit status 1</span></span></span></p>
<p>
	&nbsp;</p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">这是怎么回事呢？打开 lib/py/src/protocol/fastbinary.c 文件，看看第一行未注释的代码：</span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="color:#00f;"><span style="font-size:14px;">#include &lt;Python.h&gt;</span></span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">说明在系统路径中要能找到Python.h文件，而这个文件，是在你安装了python开发包之后才有的，所以，去安装然后再make吧。</span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">我安装的包：<span style="color:#800080;">python-devel-2.4.3-24.el5.i386.rpm</span></span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;"><strong style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(46, 46, 46); border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; "><span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; color: rgb(0, 0, 255); "><span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; "><span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; color: rgb(255, 255, 255); font-weight: normal; line-height: 20px; ">文章来源：http://www.codelast.com/</span></span></span></strong> </span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">在成功make了之后，可以看到输出的提示：</span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="color:#f00;"><span style="font-size:14px;">Build complete.</span></span></span></p>
<p>
	&nbsp;</p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">然后再make install，就可以在 /usr/local/lib/ 下（依系统不同，目录也不一定是这个）找到Thrift的库文件啦：</span></span></p>
<p>
	&nbsp;</p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">-rw-r--r-- &nbsp;1 root root 5762970 Dec 15 17:41<span style="color:#00f;"> libThrift.a</span></span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">-rwxr-xr-x &nbsp;1 root root &nbsp; &nbsp; 949 Dec 15 17:41<span style="color:#00f;"> libThrift.la</span></span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">-rw-r--r-- &nbsp;1 root root &nbsp;468526 Dec 15 17:41<span style="color:#00f;"> libThriftnb.a</span></span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">-rwxr-xr-x &nbsp;1 root root &nbsp; &nbsp; 963 Dec 15 17:41 <span style="color:#00f;">libThriftnb.la</span></span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">lrwxrwxrwx &nbsp;1 root root &nbsp; &nbsp; &nbsp;20 Dec 15 17:41<span style="color:#00f;"> libThriftnb.so -&gt; libThriftnb.so.0.0.0</span></span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">lrwxrwxrwx &nbsp;1 root root &nbsp; &nbsp; &nbsp;20 Dec 15 17:41 <span style="color:#00f;">libThriftnb.so.0 -&gt; libThriftnb.so.0.0.0</span></span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">-rwxr-xr-x &nbsp;1 root root &nbsp;339359 Dec 15 17:41 <span style="color:#00f;">libThriftnb.so.0.0.0</span></span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">lrwxrwxrwx &nbsp;1 root root &nbsp; &nbsp; &nbsp;18 Dec 15 17:41<span style="color:#00f;"> libThrift.so -&gt; libThrift.so.0.0.0</span></span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">lrwxrwxrwx &nbsp;1 root root &nbsp; &nbsp; &nbsp;18 Dec 15 17:41 <span style="color:#00f;">libThrift.so.0 -&gt; libThrift.so.0.0.0</span></span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">-rwxr-xr-x &nbsp;1 root root 3308490 Dec 15 17:41<span style="color:#00f;"> libThrift.so.0.0.0</span></span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">-rw-r--r-- &nbsp;1 root root &nbsp;184672 Dec 15 17:41<span style="color:#00f;"> libThriftz.a</span></span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">-rwxr-xr-x &nbsp;1 root root &nbsp; &nbsp; 956 Dec 15 17:41 <span style="color:#00f;">libThriftz.la</span></span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">lrwxrwxrwx &nbsp;1 root root &nbsp; &nbsp; &nbsp;19 Dec 15 17:41<span style="color:#00f;"> libThriftz.so -&gt; libThriftz.so.0.0.0</span></span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">lrwxrwxrwx &nbsp;1 root root &nbsp; &nbsp; &nbsp;19 Dec 15 17:41<span style="color:#00f;"> libThriftz.so.0 -&gt; libThriftz.so.0.0.0</span></span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">-rwxr-xr-x &nbsp;1 root root &nbsp;145732 Dec 15 17:41 <span style="color:#00f;">libThriftz.so.0.0.0</span></span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;"><strong style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(46, 46, 46); border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; "><span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; color: rgb(0, 0, 255); "><span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; "><span style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; color: rgb(255, 255, 255); font-weight: normal; line-height: 20px; ">文章来源：http://www.codelast.com/</span></span></span></strong> </span></span></p>
<p>
	<span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:14px;">然后就可以开始你的Thrift C++开发之旅了！</span></span></p>
<p>
	<br />
	<span style="color: rgb(255, 255, 255);">文章来源：</span><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><span style="color: rgb(255, 255, 255);">https://www.codelast.com/</span></a><br />
	<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;版权声明&nbsp;<span style="color: rgb(255, 0, 0);">➤➤</span>&nbsp;<br />
	转载需注明出处：<u><a href="https://www.codelast.com/" rel="noopener noreferrer" target="_blank"><em><span style="color: rgb(0, 0, 255);"><strong style="font-size: 16px;"><span style="font-family: arial, helvetica, sans-serif;">codelast.com</span></strong></span></em></a></u>&nbsp;<br />
	感谢关注我的微信公众号（微信扫一扫）：</p>
<p style="border: 0px; font-size: 13px; margin: 0px 0px 9px; outline: 0px; padding: 0px; color: rgb(77, 77, 77);">
	<img decoding="async" alt="wechat qrcode of codelast" src="https://www.codelast.com/codelast_wechat_qr_code.jpg" style="width: 200px; height: 200px;" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codelast.com/%e5%8e%9f%e5%88%9b%e5%9c%a8rhel%e4%b8%8a%e5%ae%89%e8%a3%85thrift%ef%bc%88%e6%94%af%e6%8c%81c%ef%bc%89%e7%9a%84%e8%8b%a5%e5%b9%b2%e9%97%ae%e9%a2%98/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
