<?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>海波无痕</title>
	<atom:link href="http://blog.ziki.cn/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.ziki.cn</link>
	<description>我的技术博客</description>
	<lastBuildDate>Wed, 09 May 2012 01:49:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<image>
<link>http://blog.ziki.cn</link>
<url>http://www.ziki.cn/animated_favicon1.gif</url>
<title>海波无痕</title>
</image>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>ubuntu安装hive</title>
		<link>http://blog.ziki.cn/992.html</link>
		<comments>http://blog.ziki.cn/992.html#comments</comments>
		<pubDate>Wed, 09 May 2012 01:49:58 +0000</pubDate>
		<dc:creator>ziki</dc:creator>
				<category><![CDATA[javaee]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[hadoop]]></category>
		<category><![CDATA[hive]]></category>
		<category><![CDATA[hivesql]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.ziki.cn/?p=992</guid>
		<description><![CDATA[<p>环境:ubuntu-12.04-server-amd64</p>
<p>JDK1.7</p>
<p>hidoop分布式请看<a href="http://blog.ziki.cn/984.html" target="_blank">http://blog.ziki.cn/984.html</a></p>
<p>如把hadoop当作数据库的存储部分的话，那么hive可以理解为一个sql语言解释器,或者可以叫执行类SQL语言的shell解释器。</p>
<p>使用hive中可以使用表的操作select/insert/create来映射到hadoop的hdfs系统中一系列文本操作，可以理解为sql对hdfs的行为映射.</p>
<p>更可以通过实现自定义的udf、udaf来实现复杂的筛选select,这些带有函数的select语句hive会自动翻译成hadoop的mapreduce来执行job最终返回结果</p>
<p>返回结果可以直接输出也可以直接insert到一张hive创建的表,这样的话就将算出的最终结果持久化回hadoop的hdfs中,可以通过haddop的命令行直接访问最终结果。</p>
<p>当然用hive更是可以访问。</p>
<p>1、获取hive-0.8.1.tar.gz</p>
<p>2、解压缩到/opt/hive-0.8.1</p>
<p>3、vi /etc/prfole</p>
<p>export HIVE_HOME=/opt/hive-0.8.1<br />
	<br />
	export PATH=$HIVE_HOME/bin:$PATH</p>
<p>4、vi /opt/hive-0.8.1/conf/hive-env.sh</p>
<p>HADOOP_HOME=/opt/hadoop-1.0.1</p>
<p>5、准备一个mysql数据库并命名为hive<br />
	<br />
	6、vi /opt/hive-0.8.1/conf/hive-site.xml</p>
<p>&#160;&#60;configuration&#62;<br />
	&#160;&#160;&#160; &#60;property&#62;<br />
	&#160;&#160;&#160; &#60;name&#62;hive.metastore.local&#60;/name&#62;<br />
	&#160;&#160;&#160;&#160;&#160; &#60;value&#62;true&#60;/value&#62;<br />
	&#160;&#160;&#160; &#60;/property&#62;<br />
	<br />
	&#160;&#160;&#160; &#60;property&#62;<br />
	&#160;&#160;&#160; &#60;name&#62;javax.jdo.option.ConnectionURL&#60;/name&#62;<br />
	&#160;&#160;&#160;&#160;&#160; &#60;value&#62;jdbc:mysql://192.168.122.104:3306/hive&#60;/value&#62;<br />
	&#160;&#160;&#160; &#60;/property&#62;<br />
	<br />
	&#160;&#160;&#160; &#60;property&#62;<br />
	&#160;&#160;&#160; &#60;name&#62;javax.jdo.option.ConnectionDriverName&#60;/name&#62;<br />
	&#160;&#160;&#160;&#160;&#160; &#60;value&#62;com.mysql.jdbc.Driver&#60;/value&#62;<br />
	&#160;&#160;&#160; &#60;/property&#62;<br />
	<br />
	&#160;&#160;&#160; &#60;property&#62;<br />
	&#160;&#160;&#160;&#160;&#160; &#60;name&#62;javax.jdo.option.ConnectionUserName&#60;/name&#62;<br />
	&#160;&#160;&#160;&#160;&#160; &#60;value&#62;hiveuser&#60;/value&#62;<br />
	&#160;&#160;&#160; &#60;/property&#62;<br />
	<br />
	&#160;&#160;&#160; &#60;property&#62;<br />
	&#160;&#160;&#160;&#160;&#160; &#60;name&#62;javax.jdo.option.ConnectionPassword&#60;/name&#62;<br />
	&#160;&#160;&#160;&#160;&#160; &#60;value&#62;hiveuser&#60;/value&#62;<br />
	&#160;&#160;&#160; &#60;/property&#62;<br />
	&#160;&#160;&#160; &#60;property&#62;<br />
	&#160;&#160;&#160;&#160;&#160; &#60;name&#62;datanucleus.fixedDatastore&#60;/name&#62;<br />
	&#160;&#160;&#160;&#160;&#160; &#60;value&#62;false&#60;/value&#62;<br />
	&#160;&#160;&#160; &#60;/property&#62;<br />
	&#160;&#160;&#160; &#60;/configuration&#62;<br />
	<br />
	<br />
	7、打开hive</p>
<p>hive</p>
<p>当前hive的shell感觉跟mysql的客户端shell差不多,在下边就可以运行hivesql了。</p>
<p>建表</p>
<p>hive&#62;create table access_log(url STRING,count_no STRING);</p>
<p>导入数据</p>
<p>hive&#62;LOAD DATA LOCAL INPATH &#39;/opt/access_log/access.log&#39; OVERWRITE INTO TABLE access_log;</p>
<p>可以看到,这句sql产生了hadoop的hdfs文件</p>
<p>ubuntu@server1:/$ /opt/hadoop-1.0.1/bin/hadoop dfs -ls /user/hive/warehouse<br />
	Found 1 items<br />
	drwxr-xr-x&#160;&#160; - ubuntu supergroup&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 0 2012-05-07 19:03 /user/hive/warehouse/access_log<br />
	&#160;</p>
<p>hive&#62; show tables;</p>
<p>access_log<br />
	OK<br />
	Time taken: 4.003 seconds<br />
	&#160;</p>
<p>hive&#62;select count(*) from access_log;</p>
<p>可以看到select count(*) from access_log 语句的执行就产生了一个hadoop的mapreduce 来运行。这个过程被hive封装了</p>
<p>hive&#62; select count(*)&#160; from access_log;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;<br />
	Total MapReduce jobs = 1<br />
	Launching Job 1 out of 1<br />
	Number of reduce tasks determined at compile time: 1<br />
	In order to change the average load for a reducer (in bytes):<br />
	&#160; set hive.exec.reducers.bytes.per.reducer=&#60;number&#62;<br />
	In order to limit the maximum number of reducers:<br />
	&#160; set hive.exec.reducers.max=&#60;number&#62;<br />
	In order to set a constant number of reducers:<br />
	&#160; set mapred.reduce.tasks=&#60;number&#62;<br />
	Starting Job = job_201205090916_0001, Tracking URL = http://server1:50030/jobdetails.jsp?jobid=job_201205090916_0001<br />
	Kill Command = /opt/hadoop-1.0.1/libexec/../bin/hadoop job&#160; -Dmapred.job.tracker=hdfs://server1:9001 -kill job_201205090916_0001<br />
	Hadoop job information for Stage-1: number of mappers: 1; number of reducers: 1<br />
	2012-05-09 09:46:07,510 Stage-1 map = 0%,&#160; reduce = 0%<br />
	2012-05-09 09:46:12,621 Stage-1 map = 100%,&#160; reduce = 0%, Cumulative CPU 0.99 sec<br />
	2012-05-09 09:46:13,633 Stage-1 map = 100%,&#160; reduce = 0%, Cumulative CPU 0.99 sec<br />
	2012-05-09 09:46:14,649 Stage-1 map = 100%,&#160; reduce = 0%, Cumulative CPU 0.99 sec<br />
	2012-05-09 09:46:15,680 Stage-1 map = 100%,&#160; reduce = 0%, Cumulative CPU 0.99 sec<br />
	2012-05-09 09:46:16,707 Stage-1 map = 100%,&#160; reduce = 0%, Cumulative CPU 0.99 sec<br />
	2012-05-09 09:46:17,728 Stage-1 map = 100%,&#160; reduce = 0%, Cumulative CPU 0.99 sec<br />
	2012-05-09 09:46:18,748 Stage-1 map = 100%,&#160; reduce = 0%, Cumulative CPU 0.99 sec<br />
	2012-05-09 09:46:19,763 Stage-1 map = 100%,&#160; reduce = 0%, Cumulative CPU 0.99 sec<br />
	2012-05-09 09:46:20,774 Stage-1 map = 100%,&#160; reduce = 0%, Cumulative CPU 0.99 sec<br />
	2012-05-09 09:46:21,785 Stage-1 map = 100%,&#160; reduce = 33%, Cumulative CPU 0.99 sec<br />
	2012-05-09 09:46:22,811 Stage-1 map = 100%,&#160; reduce = 33%, Cumulative CPU 0.99 sec<br />
	2012-05-09 09:46:23,883 Stage-1 map = 100%,&#160; reduce = 33%, Cumulative CPU 0.99 sec<br />
	2012-05-09 09:46:24,894 Stage-1 map = 100%,&#160; reduce = 100%, Cumulative CPU 3.83 sec<br />
	2012-05-09 09:46:25,914 Stage-1 map = 100%,&#160; reduce = 100%, Cumulative CPU 3.83 sec<br />
	2012-05-09 09:46:26,930 Stage-1 map = 100%,&#160; reduce = 100%, Cumulative CPU 3.83 sec<br />
	2012-05-09 09:46:27,960 Stage-1 map = 100%,&#160; reduce = 100%, Cumulative CPU 3.83 sec<br />
	2012-05-09 09:46:29,009 Stage-1 map = 100%,&#160; reduce = 100%, Cumulative CPU 3.83 sec<br />
	2012-05-09 09:46:30,025 Stage-1 map = 100%,&#160; reduce = 100%, Cumulative CPU 3.83 sec<br />
	2012-05-09 09:46:31,045 Stage-1 map = 100%,&#160; reduce = 100%, Cumulative CPU 3.83 sec<br />
	MapReduce Total cumulative CPU time: 3 seconds 830 msec<br />
	Ended Job = job_201205090916_0001<br />
	MapReduce Jobs Launched:<br />
	Job 0: Map: 1&#160; Reduce: 1&#160;&#160; Accumulative CPU: 3.83 sec&#160;&#160; HDFS Read: 4951 HDFS Write: 3 SUCESS<br />
	Total MapReduce CPU Time Spent: 3 seconds 830 msec<br />
	OK<br />
	21<br />
	Time taken: 35.107 seconds</p>]]></description>
			<content:encoded><![CDATA[<p>环境:ubuntu-12.04-server-amd64</p>
<p>JDK1.7</p>
<p>hidoop分布式请看<a href="http://blog.ziki.cn/984.html" target="_blank">http://blog.ziki.cn/984.html</a></p>
<p>如把hadoop当作数据库的存储部分的话，那么hive可以理解为一个sql语言解释器,或者可以叫执行类SQL语言的shell解释器。</p>
<p>使用hive中可以使用表的操作select/insert/create来映射到hadoop的hdfs系统中一系列文本操作，可以理解为sql对hdfs的行为映射.</p>
<p>更可以通过实现自定义的udf、udaf来实现复杂的筛选select,这些带有函数的select语句hive会自动翻译成hadoop的mapreduce来执行job最终返回结果</p>
<p>返回结果可以直接输出也可以直接insert到一张hive创建的表,这样的话就将算出的最终结果持久化回hadoop的hdfs中,可以通过haddop的命令行直接访问最终结果。</p>
<p>当然用hive更是可以访问。</p>
<p>1、获取hive-0.8.1.tar.gz</p>
<p>2、解压缩到/opt/hive-0.8.1</p>
<p>3、vi /etc/prfole</p>
<p>export HIVE_HOME=/opt/hive-0.8.1</p>
<p>	export PATH=$HIVE_HOME/bin:$PATH</p>
<p>4、vi /opt/hive-0.8.1/conf/hive-env.sh</p>
<p>HADOOP_HOME=/opt/hadoop-1.0.1</p>
<p>5、准备一个mysql数据库并命名为hive</p>
<p>	6、vi /opt/hive-0.8.1/conf/hive-site.xml</p>
<p>&nbsp;&lt;configuration&gt;<br />
	&nbsp;&nbsp;&nbsp; &lt;property&gt;<br />
	&nbsp;&nbsp;&nbsp; &lt;name&gt;hive.metastore.local&lt;/name&gt;<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;value&gt;true&lt;/value&gt;<br />
	&nbsp;&nbsp;&nbsp; &lt;/property&gt;</p>
<p>	&nbsp;&nbsp;&nbsp; &lt;property&gt;<br />
	&nbsp;&nbsp;&nbsp; &lt;name&gt;javax.jdo.option.ConnectionURL&lt;/name&gt;<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;value&gt;jdbc:mysql://192.168.122.104:3306/hive&lt;/value&gt;<br />
	&nbsp;&nbsp;&nbsp; &lt;/property&gt;</p>
<p>	&nbsp;&nbsp;&nbsp; &lt;property&gt;<br />
	&nbsp;&nbsp;&nbsp; &lt;name&gt;javax.jdo.option.ConnectionDriverName&lt;/name&gt;<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;value&gt;com.mysql.jdbc.Driver&lt;/value&gt;<br />
	&nbsp;&nbsp;&nbsp; &lt;/property&gt;</p>
<p>	&nbsp;&nbsp;&nbsp; &lt;property&gt;<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;name&gt;javax.jdo.option.ConnectionUserName&lt;/name&gt;<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;value&gt;hiveuser&lt;/value&gt;<br />
	&nbsp;&nbsp;&nbsp; &lt;/property&gt;</p>
<p>	&nbsp;&nbsp;&nbsp; &lt;property&gt;<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;name&gt;javax.jdo.option.ConnectionPassword&lt;/name&gt;<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;value&gt;hiveuser&lt;/value&gt;<br />
	&nbsp;&nbsp;&nbsp; &lt;/property&gt;<br />
	&nbsp;&nbsp;&nbsp; &lt;property&gt;<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;name&gt;datanucleus.fixedDatastore&lt;/name&gt;<br />
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;value&gt;false&lt;/value&gt;<br />
	&nbsp;&nbsp;&nbsp; &lt;/property&gt;<br />
	&nbsp;&nbsp;&nbsp; &lt;/configuration&gt;</p>
<p>
	7、打开hive</p>
<p>hive</p>
<p>当前hive的shell感觉跟mysql的客户端shell差不多,在下边就可以运行hivesql了。</p>
<p>建表</p>
<p>hive&gt;create table access_log(url STRING,count_no STRING);</p>
<p>导入数据</p>
<p>hive&gt;LOAD DATA LOCAL INPATH &#39;/opt/access_log/access.log&#39; OVERWRITE INTO TABLE access_log;</p>
<p>可以看到,这句sql产生了hadoop的hdfs文件</p>
<p>ubuntu@server1:/$ /opt/hadoop-1.0.1/bin/hadoop dfs -ls /user/hive/warehouse<br />
	Found 1 items<br />
	drwxr-xr-x&nbsp;&nbsp; - ubuntu supergroup&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 2012-05-07 19:03 /user/hive/warehouse/access_log<br />
	&nbsp;</p>
<p>hive&gt; show tables;</p>
<p>access_log<br />
	OK<br />
	Time taken: 4.003 seconds<br />
	&nbsp;</p>
<p>hive&gt;select count(*) from access_log;</p>
<p>可以看到select count(*) from access_log 语句的执行就产生了一个hadoop的mapreduce 来运行。这个过程被hive封装了</p>
<p>hive&gt; select count(*)&nbsp; from access_log;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<br />
	Total MapReduce jobs = 1<br />
	Launching Job 1 out of 1<br />
	Number of reduce tasks determined at compile time: 1<br />
	In order to change the average load for a reducer (in bytes):<br />
	&nbsp; set hive.exec.reducers.bytes.per.reducer=&lt;number&gt;<br />
	In order to limit the maximum number of reducers:<br />
	&nbsp; set hive.exec.reducers.max=&lt;number&gt;<br />
	In order to set a constant number of reducers:<br />
	&nbsp; set mapred.reduce.tasks=&lt;number&gt;<br />
	Starting Job = job_201205090916_0001, Tracking URL = http://server1:50030/jobdetails.jsp?jobid=job_201205090916_0001<br />
	Kill Command = /opt/hadoop-1.0.1/libexec/../bin/hadoop job&nbsp; -Dmapred.job.tracker=hdfs://server1:9001 -kill job_201205090916_0001<br />
	Hadoop job information for Stage-1: number of mappers: 1; number of reducers: 1<br />
	2012-05-09 09:46:07,510 Stage-1 map = 0%,&nbsp; reduce = 0%<br />
	2012-05-09 09:46:12,621 Stage-1 map = 100%,&nbsp; reduce = 0%, Cumulative CPU 0.99 sec<br />
	2012-05-09 09:46:13,633 Stage-1 map = 100%,&nbsp; reduce = 0%, Cumulative CPU 0.99 sec<br />
	2012-05-09 09:46:14,649 Stage-1 map = 100%,&nbsp; reduce = 0%, Cumulative CPU 0.99 sec<br />
	2012-05-09 09:46:15,680 Stage-1 map = 100%,&nbsp; reduce = 0%, Cumulative CPU 0.99 sec<br />
	2012-05-09 09:46:16,707 Stage-1 map = 100%,&nbsp; reduce = 0%, Cumulative CPU 0.99 sec<br />
	2012-05-09 09:46:17,728 Stage-1 map = 100%,&nbsp; reduce = 0%, Cumulative CPU 0.99 sec<br />
	2012-05-09 09:46:18,748 Stage-1 map = 100%,&nbsp; reduce = 0%, Cumulative CPU 0.99 sec<br />
	2012-05-09 09:46:19,763 Stage-1 map = 100%,&nbsp; reduce = 0%, Cumulative CPU 0.99 sec<br />
	2012-05-09 09:46:20,774 Stage-1 map = 100%,&nbsp; reduce = 0%, Cumulative CPU 0.99 sec<br />
	2012-05-09 09:46:21,785 Stage-1 map = 100%,&nbsp; reduce = 33%, Cumulative CPU 0.99 sec<br />
	2012-05-09 09:46:22,811 Stage-1 map = 100%,&nbsp; reduce = 33%, Cumulative CPU 0.99 sec<br />
	2012-05-09 09:46:23,883 Stage-1 map = 100%,&nbsp; reduce = 33%, Cumulative CPU 0.99 sec<br />
	2012-05-09 09:46:24,894 Stage-1 map = 100%,&nbsp; reduce = 100%, Cumulative CPU 3.83 sec<br />
	2012-05-09 09:46:25,914 Stage-1 map = 100%,&nbsp; reduce = 100%, Cumulative CPU 3.83 sec<br />
	2012-05-09 09:46:26,930 Stage-1 map = 100%,&nbsp; reduce = 100%, Cumulative CPU 3.83 sec<br />
	2012-05-09 09:46:27,960 Stage-1 map = 100%,&nbsp; reduce = 100%, Cumulative CPU 3.83 sec<br />
	2012-05-09 09:46:29,009 Stage-1 map = 100%,&nbsp; reduce = 100%, Cumulative CPU 3.83 sec<br />
	2012-05-09 09:46:30,025 Stage-1 map = 100%,&nbsp; reduce = 100%, Cumulative CPU 3.83 sec<br />
	2012-05-09 09:46:31,045 Stage-1 map = 100%,&nbsp; reduce = 100%, Cumulative CPU 3.83 sec<br />
	MapReduce Total cumulative CPU time: 3 seconds 830 msec<br />
	Ended Job = job_201205090916_0001<br />
	MapReduce Jobs Launched:<br />
	Job 0: Map: 1&nbsp; Reduce: 1&nbsp;&nbsp; Accumulative CPU: 3.83 sec&nbsp;&nbsp; HDFS Read: 4951 HDFS Write: 3 SUCESS<br />
	Total MapReduce CPU Time Spent: 3 seconds 830 msec<br />
	OK<br />
	21<br />
	Time taken: 35.107 seconds</p>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创文章，转载请注明：</strong> 转载自<a href="http://blog.ziki.cn/">海波无痕</a></p>
<p><strong>本文链接地址:</strong> <a href="http://blog.ziki.cn/992.html">ubuntu安装hive</a></p>
</div>
<p style="margin-top: 0; margin-bottom: 15px; color: #888888; font-size: 80%; font-style: italic">文章的脚注信息由WordPress的<a href="http://easwy.com/blog/wordpress/wp-posturl/" style="color: #8888FF; text-decoration: underline;">wp-posturl插件</a>自动生成</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ziki.cn/992.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>hadoop分布式配置</title>
		<link>http://blog.ziki.cn/984.html</link>
		<comments>http://blog.ziki.cn/984.html#comments</comments>
		<pubDate>Sat, 05 May 2012 15:05:40 +0000</pubDate>
		<dc:creator>ziki</dc:creator>
				<category><![CDATA[javaee]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[hadoop]]></category>
		<category><![CDATA[hdfs]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.ziki.cn/?p=984</guid>
		<description><![CDATA[<p>环境:ubuntu-12.04-server-amd64</p>
<p>3台 ubuntu-12.04-server-amd64 server</p>
<p>分别</p>
<p>192.168.122.101 server1&#160;&#160;&#160;&#160;&#160; //主,运行NameNode+SecondaryNameNode+JobTracker</p>
<p>192.168.122.102 server2&#160;&#160;&#160;&#160; //从1 运行DataNode+TaskTracker</p>
<p>192.168.122.103 server3&#160;&#160; //从2 运行DataNode+TaskTracker</p>
<p>1、配置java环境(server1、server2、server3)</p>
<p>下载jdk-7u3-linux-x64.tar.gz</p>
<p>/opt/java/jdk/jdk1.7.0_03</p>
<p>配置一个软链接</p>
<p>ln -s /opt/java/jdk/jdk1.7.0_03 /opt/java/jdk/current</p>
<p>sudo vi /etc/profile</p>
<p>增加</p>
<p>export JAVA_HOME=/opt/java/jdk/current<br />
	export JRE_HOME=/opt/java/jdk/current/jre<br />
	export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH<br />
	export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH</p>
<p>保存</p>
<p>source /etc/profile</p>
<p>sudo update-alternatives --install /usr/bin/java&#160; java&#160; /opt/java/jdk/current/bin/java 300;<br />
	sudo update-alternatives --install /usr/bin/javac javac /opt/java/jdk/current/bin/javac 300;</p>
<p>2、配置/etc/hosts(server1、server2、server3)</p>
<p>192.168.122.101 server1</p>
<p>192.168.122.102 server2</p>
<p>192.168.122.103 server3</p>
<p>3、安装ssh(server1、server2、server3)</p>
<p>sudo apt-get install ssh</p>
<p>4、ssh免登录(server1)</p>
<p>ssh-keygen -t dsa -P &#39;&#39; -f ~/.ssh/id_dsa<br />
	cat ~/.ssh/id_dsa.pub &#62;&#62; ~/.ssh/authorized_keys</p>
<p>scp /home/ubuntu/.ssh/id_dsa.pub ubuntu@server2:/home/ubuntu</p>
<p>scp /home/ubuntu/.ssh/id_dsa.pub ubuntu@server3:/home/ubuntu</p>
<p>5、ssh免登录(server2、server3)</p>
<p>mkdir ~/.ssh</p>
<p>mv&#160; ~/id_dsa.pub ~/.ssh</p>
<p>cat ~/.ssh/id_dsa.pub &#62;&#62; ~/.ssh/authorized_keys</p>
<p>6、下载hadoop-1.0.1.tar.gz(server1、server2、server3)</p>
<p>解压缩到/opt/hadoop-1.0.1</p>
<p>vi /opt/hadoop-1.0.1/conf/hadoop-env.sh</p>
<p>打开注释并设置JAVA_HOME</p>
<p>export JAVA_HOME=/opt/java/jdk/current<br />
	&#160;</p>
<p>vi /opt/hadoop-1.0.1/conf/core-site.xml</p>
<p>&#60;configuration&#62;<br />
	&#60;property&#62;<br />
	&#60;name&#62;fs.default.name&#60;/name&#62;<br />
	&#60;value&#62;hdfs://server1:9000&#60;/value&#62;<br />
	&#60;/property&#62;</p>
<p>&#60;property&#62;<br />
	&#160;&#160;&#160; &#60;name&#62;hadoop.tmp.dir&#60;/name&#62;<br />
	&#160;&#160;&#160; &#60;value&#62;/opt/hadoop/tmp/&#60;/value&#62;<br />
	&#60;/property&#62;</p>
<p><br />
	&#60;/configuration&#62;</p>
<p>vi /opt/hadoop-1.0.1/conf/hdfs-site.xml</p>
<p>&#60;configuration&#62;<br />
	&#60;property&#62;<br />
	&#60;name&#62;dfs.replication&#60;/name&#62;<br />
	&#60;value&#62;2&#60;/value&#62;<br />
	&#60;/property&#62;</p>
<p>&#60;property&#62;<br />
	&#160;&#160;&#160; &#60;name&#62;dfs.name.dir&#60;/name&#62;<br />
	&#160;&#160;&#160; &#60;value&#62;/opt/hadoop/name/&#60;/value&#62;<br />
	&#160; &#60;/property&#62;<br />
	&#160; &#60;property&#62;<br />
	&#160;&#160;&#160; &#60;name&#62;dfs.data.dir&#60;/name&#62;<br />
	&#160;&#160;&#160; &#60;value&#62;/opt/hadoop/data&#60;/value&#62;<br />
	&#160; &#60;/property&#62;<br />
	&#60;/configuration&#62;</p>
<p>vi /opt/hadoop-1.0.1/conf/mapred-site.xml:</p>
<p>&#60;configuration&#62;<br />
	&#60;property&#62;<br />
	&#60;name&#62;mapred.job.tracker&#60;/name&#62;<br />
	&#60;value&#62;hdfs://server1:9001&#60;/value&#62;<br />
	&#60;/property&#62;<br />
	&#60;/configuration&#62;</p>
<p>7、设置主从(server1)</p>
<p>vi /opt/hadoop-1.0.1/masters</p>
<p>server1</p>
<p>vi /opt/hadoop-1.0.1/slaves</p>
<p>server2</p>
<p>server3</p>
<p>8、启动hadoop</p>
<p>&#160;</p>
<div>ubuntu@server1:~$ cd /opt/hadoop-1.0.1/bin/</div>
<div>
	<div>ubuntu@server1:/opt/hadoop-1.0.1/bin$ ./hadoop namenode -format</div>
	<div>&#160;</div>
	<div>&#160;</div>
	<div>&#160;</div>
	<div>&#160;</div>
</div>
<div>ubuntu@server1:/opt/hadoop-1.0.1/bin$ ./start-all.sh&#160;</div>
<div>&#160;</div>
<div>starting namenode, logging to /opt/hadoop-1.0.1/libexec/../logs/hadoop-ubuntu-namenode-server1.out</div>
<div>server2: starting datanode, logging to /opt/hadoop-1.0.1/libexec/../logs/hadoop-ubuntu-datanode-server2.out</div>
<div>server3: starting datanode, logging to /opt/hadoop-1.0.1/libexec/../logs/hadoop-ubuntu-datanode-server3.out</div>
<div>server1: starting secondarynamenode, logging to /opt/hadoop-1.0.1/libexec/../logs/hadoop-ubuntu-secondarynamenode-server1.out</div>
<div>starting jobtracker, logging to /opt/hadoop-1.0.1/libexec/../logs/hadoop-ubuntu-jobtracker-server1.out</div>
<div>server3: starting tasktracker, logging to /opt/hadoop-1.0.1/libexec/../logs/hadoop-ubuntu-tasktracker-server3.out</div>
<div>server2: starting tasktracker, logging to /opt/hadoop-1.0.1/libexec/../logs/hadoop-ubuntu-tasktracker-server2.out</div>
<div>&#160;</div>
<p>9、查看启动情况(server1,server2,server3)</p>
<p>ubuntu@server1:/$ jps<br />
	1544 SecondaryNameNode<br />
	1749 Jps<br />
	1628 JobTracker<br />
	1273 NameNode<br />
	&#160;</p>
<p>ubuntu@server2:~$ jps<br />
	1135 DataNode<br />
	1645 Jps<br />
	1327 TaskTracker<br />
	&#160;</p>
<p>ubuntu@server3:~$ jps<br />
	1271 TaskTracker<br />
	1615 Jps<br />
	1084 DataNode<br />
	&#160;</p>
<p>10、查看</p>
<p>查看任务调度</p>
<p>http://server1:50030/</p>
<p>查看name</p>
<p>http://server1:50070</p>]]></description>
			<content:encoded><![CDATA[<p>环境:ubuntu-12.04-server-amd64</p>
<p>3台 ubuntu-12.04-server-amd64 server</p>
<p>分别</p>
<p>192.168.122.101 server1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //主,运行NameNode+SecondaryNameNode+JobTracker</p>
<p>192.168.122.102 server2&nbsp;&nbsp;&nbsp;&nbsp; //从1 运行DataNode+TaskTracker</p>
<p>192.168.122.103 server3&nbsp;&nbsp; //从2 运行DataNode+TaskTracker</p>
<p>1、配置java环境(server1、server2、server3)</p>
<p>下载jdk-7u3-linux-x64.tar.gz</p>
<p>/opt/java/jdk/jdk1.7.0_03</p>
<p>配置一个软链接</p>
<p>ln -s /opt/java/jdk/jdk1.7.0_03 /opt/java/jdk/current</p>
<p>sudo vi /etc/profile</p>
<p>增加</p>
<p>export JAVA_HOME=/opt/java/jdk/current<br />
	export JRE_HOME=/opt/java/jdk/current/jre<br />
	export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH<br />
	export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH</p>
<p>保存</p>
<p>source /etc/profile</p>
<p>sudo update-alternatives --install /usr/bin/java&nbsp; java&nbsp; /opt/java/jdk/current/bin/java 300;<br />
	sudo update-alternatives --install /usr/bin/javac javac /opt/java/jdk/current/bin/javac 300;</p>
<p>2、配置/etc/hosts(server1、server2、server3)</p>
<p>192.168.122.101 server1</p>
<p>192.168.122.102 server2</p>
<p>192.168.122.103 server3</p>
<p>3、安装ssh(server1、server2、server3)</p>
<p>sudo apt-get install ssh</p>
<p>4、ssh免登录(server1)</p>
<p>ssh-keygen -t dsa -P &#39;&#39; -f ~/.ssh/id_dsa<br />
	cat ~/.ssh/id_dsa.pub &gt;&gt; ~/.ssh/authorized_keys</p>
<p>scp /home/ubuntu/.ssh/id_dsa.pub ubuntu@server2:/home/ubuntu</p>
<p>scp /home/ubuntu/.ssh/id_dsa.pub ubuntu@server3:/home/ubuntu</p>
<p>5、ssh免登录(server2、server3)</p>
<p>mkdir ~/.ssh</p>
<p>mv&nbsp; ~/id_dsa.pub ~/.ssh</p>
<p>cat ~/.ssh/id_dsa.pub &gt;&gt; ~/.ssh/authorized_keys</p>
<p>6、下载hadoop-1.0.1.tar.gz(server1、server2、server3)</p>
<p>解压缩到/opt/hadoop-1.0.1</p>
<p>vi /opt/hadoop-1.0.1/conf/hadoop-env.sh</p>
<p>打开注释并设置JAVA_HOME</p>
<p>export JAVA_HOME=/opt/java/jdk/current<br />
	&nbsp;</p>
<p>vi /opt/hadoop-1.0.1/conf/core-site.xml</p>
<p>&lt;configuration&gt;<br />
	&lt;property&gt;<br />
	&lt;name&gt;fs.default.name&lt;/name&gt;<br />
	&lt;value&gt;hdfs://server1:9000&lt;/value&gt;<br />
	&lt;/property&gt;</p>
<p>&lt;property&gt;<br />
	&nbsp;&nbsp;&nbsp; &lt;name&gt;hadoop.tmp.dir&lt;/name&gt;<br />
	&nbsp;&nbsp;&nbsp; &lt;value&gt;/opt/hadoop/tmp/&lt;/value&gt;<br />
	&lt;/property&gt;</p>
<p>
	&lt;/configuration&gt;</p>
<p>vi /opt/hadoop-1.0.1/conf/hdfs-site.xml</p>
<p>&lt;configuration&gt;<br />
	&lt;property&gt;<br />
	&lt;name&gt;dfs.replication&lt;/name&gt;<br />
	&lt;value&gt;2&lt;/value&gt;<br />
	&lt;/property&gt;</p>
<p>&lt;property&gt;<br />
	&nbsp;&nbsp;&nbsp; &lt;name&gt;dfs.name.dir&lt;/name&gt;<br />
	&nbsp;&nbsp;&nbsp; &lt;value&gt;/opt/hadoop/name/&lt;/value&gt;<br />
	&nbsp; &lt;/property&gt;<br />
	&nbsp; &lt;property&gt;<br />
	&nbsp;&nbsp;&nbsp; &lt;name&gt;dfs.data.dir&lt;/name&gt;<br />
	&nbsp;&nbsp;&nbsp; &lt;value&gt;/opt/hadoop/data&lt;/value&gt;<br />
	&nbsp; &lt;/property&gt;<br />
	&lt;/configuration&gt;</p>
<p>vi /opt/hadoop-1.0.1/conf/mapred-site.xml:</p>
<p>&lt;configuration&gt;<br />
	&lt;property&gt;<br />
	&lt;name&gt;mapred.job.tracker&lt;/name&gt;<br />
	&lt;value&gt;hdfs://server1:9001&lt;/value&gt;<br />
	&lt;/property&gt;<br />
	&lt;/configuration&gt;</p>
<p>7、设置主从(server1)</p>
<p>vi /opt/hadoop-1.0.1/masters</p>
<p>server1</p>
<p>vi /opt/hadoop-1.0.1/slaves</p>
<p>server2</p>
<p>server3</p>
<p>8、启动hadoop</p>
<p>&nbsp;</p>
<div>ubuntu@server1:~$ cd /opt/hadoop-1.0.1/bin/</div>
<div>
<div>ubuntu@server1:/opt/hadoop-1.0.1/bin$ ./hadoop namenode -format</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
</div>
<div>ubuntu@server1:/opt/hadoop-1.0.1/bin$ ./start-all.sh&nbsp;</div>
<div>&nbsp;</div>
<div>starting namenode, logging to /opt/hadoop-1.0.1/libexec/../logs/hadoop-ubuntu-namenode-server1.out</div>
<div>server2: starting datanode, logging to /opt/hadoop-1.0.1/libexec/../logs/hadoop-ubuntu-datanode-server2.out</div>
<div>server3: starting datanode, logging to /opt/hadoop-1.0.1/libexec/../logs/hadoop-ubuntu-datanode-server3.out</div>
<div>server1: starting secondarynamenode, logging to /opt/hadoop-1.0.1/libexec/../logs/hadoop-ubuntu-secondarynamenode-server1.out</div>
<div>starting jobtracker, logging to /opt/hadoop-1.0.1/libexec/../logs/hadoop-ubuntu-jobtracker-server1.out</div>
<div>server3: starting tasktracker, logging to /opt/hadoop-1.0.1/libexec/../logs/hadoop-ubuntu-tasktracker-server3.out</div>
<div>server2: starting tasktracker, logging to /opt/hadoop-1.0.1/libexec/../logs/hadoop-ubuntu-tasktracker-server2.out</div>
<div>&nbsp;</div>
<p>9、查看启动情况(server1,server2,server3)</p>
<p>ubuntu@server1:/$ jps<br />
	1544 SecondaryNameNode<br />
	1749 Jps<br />
	1628 JobTracker<br />
	1273 NameNode<br />
	&nbsp;</p>
<p>ubuntu@server2:~$ jps<br />
	1135 DataNode<br />
	1645 Jps<br />
	1327 TaskTracker<br />
	&nbsp;</p>
<p>ubuntu@server3:~$ jps<br />
	1271 TaskTracker<br />
	1615 Jps<br />
	1084 DataNode<br />
	&nbsp;</p>
<p>10、查看</p>
<p>查看任务调度</p>
<p>http://server1:50030/</p>
<p>查看name</p>
<p>http://server1:50070</p>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创文章，转载请注明：</strong> 转载自<a href="http://blog.ziki.cn/">海波无痕</a></p>
<p><strong>本文链接地址:</strong> <a href="http://blog.ziki.cn/984.html">hadoop分布式配置</a></p>
</div>
<p style="margin-top: 0; margin-bottom: 15px; color: #888888; font-size: 80%; font-style: italic">文章的脚注信息由WordPress的<a href="http://easwy.com/blog/wordpress/wp-posturl/" style="color: #8888FF; text-decoration: underline;">wp-posturl插件</a>自动生成</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ziki.cn/984.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ubuntu系统连接思科vpn</title>
		<link>http://blog.ziki.cn/981.html</link>
		<comments>http://blog.ziki.cn/981.html#comments</comments>
		<pubDate>Wed, 02 May 2012 14:13:46 +0000</pubDate>
		<dc:creator>ziki</dc:creator>
				<category><![CDATA[server]]></category>
		<category><![CDATA[cisco]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[vpn]]></category>
		<category><![CDATA[vpnc]]></category>

		<guid isPermaLink="false">http://blog.ziki.cn/?p=981</guid>
		<description><![CDATA[<p>1、sudo apt-get install network-manager-vpnc;</p>
<p>2、新建/data/remote.conf</p>
<p>IPSec gateway 11.11.11.11<br />
	IPSec ID cisco<br />
	IPSec secret 1234567890<br />
	Xauth username haha<br />
	Xauth password hehe</p>
<p>3、mkdir ~/.sudopass;</p>
<p>&#160;&#160;&#160;&#160; touch ~/.sudopass/sudopass.secret</p>
<p>&#160;&#160;&#160; gedit ~/.sudopass/sudopass.secret</p>
<p>写入root的密码,并保存。</p>
<p>4、输入命令</p>
<p>sudo -u root -S vpnc /data/remote --enable-1des --local-port 0 --dns-update no &#60; ~/.sudopass/sudopass.secret<br />
	&#160;</p>]]></description>
			<content:encoded><![CDATA[<p>1、sudo apt-get install network-manager-vpnc;</p>
<p>2、新建/data/remote.conf</p>
<p>IPSec gateway 11.11.11.11<br />
	IPSec ID cisco<br />
	IPSec secret 1234567890<br />
	Xauth username haha<br />
	Xauth password hehe</p>
<p>3、mkdir ~/.sudopass;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; touch ~/.sudopass/sudopass.secret</p>
<p>&nbsp;&nbsp;&nbsp; gedit ~/.sudopass/sudopass.secret</p>
<p>写入root的密码,并保存。</p>
<p>4、输入命令</p>
<p>sudo -u root -S vpnc /data/remote --enable-1des --local-port 0 --dns-update no &lt; ~/.sudopass/sudopass.secret<br />
	&nbsp;</p>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创文章，转载请注明：</strong> 转载自<a href="http://blog.ziki.cn/">海波无痕</a></p>
<p><strong>本文链接地址:</strong> <a href="http://blog.ziki.cn/981.html">ubuntu系统连接思科vpn</a></p>
</div>
<p style="margin-top: 0; margin-bottom: 15px; color: #888888; font-size: 80%; font-style: italic">文章的脚注信息由WordPress的<a href="http://easwy.com/blog/wordpress/wp-posturl/" style="color: #8888FF; text-decoration: underline;">wp-posturl插件</a>自动生成</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ziki.cn/981.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ubuntu为当前用户增加组</title>
		<link>http://blog.ziki.cn/979.html</link>
		<comments>http://blog.ziki.cn/979.html#comments</comments>
		<pubDate>Mon, 30 Apr 2012 09:51:49 +0000</pubDate>
		<dc:creator>ziki</dc:creator>
				<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://blog.ziki.cn/?p=979</guid>
		<description><![CDATA[<p>将wangliang 增加到vboxusers组中</p>
<p>sudo usermod -a -G vboxusers wangliang</p>
<p>http://www.cyberciti.biz/faq/howto-linux-add-user-to-group/</p>]]></description>
			<content:encoded><![CDATA[<p>将wangliang 增加到vboxusers组中</p>
<p>sudo usermod -a -G vboxusers wangliang</p>
<p>http://www.cyberciti.biz/faq/howto-linux-add-user-to-group/</p>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创文章，转载请注明：</strong> 转载自<a href="http://blog.ziki.cn/">海波无痕</a></p>
<p><strong>本文链接地址:</strong> <a href="http://blog.ziki.cn/979.html">ubuntu为当前用户增加组</a></p>
</div>
<p style="margin-top: 0; margin-bottom: 15px; color: #888888; font-size: 80%; font-style: italic">文章的脚注信息由WordPress的<a href="http://easwy.com/blog/wordpress/wp-posturl/" style="color: #8888FF; text-decoration: underline;">wp-posturl插件</a>自动生成</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ziki.cn/979.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ubuntu 12.04 LTS 版eclipse svn报Failed to load JavaHL Library</title>
		<link>http://blog.ziki.cn/975.html</link>
		<comments>http://blog.ziki.cn/975.html#comments</comments>
		<pubDate>Mon, 30 Apr 2012 01:15:02 +0000</pubDate>
		<dc:creator>ziki</dc:creator>
				<category><![CDATA[javaee]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[jni]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[ubuntu12.04]]></category>

		<guid isPermaLink="false">http://blog.ziki.cn/?p=975</guid>
		<description><![CDATA[<p>Failed to load JavaHL Library.<br />
	These are the errors that were encountered:<br />
	no libsvnjavahl-1 in java.library.path<br />
	no svnjavahl-1 in java.library.path<br />
	no svnjavahl in java.library.path<br />
	java.library.path = /usr/lib/jni</p>
<p>按照以前的装法</p>
<p>1、sudo apt-get install libsvn-java</p>
<p>2、eclipse.ini中增加参数</p>
<p>-vmargs<br />
	-Dosgi.requiredJavaVersion=1.5<br />
	-Djava.library.path=/usr/lib/jni</p>
<p>就可以了,但安装配置好后还是报错Failed to load JavaHL Library.重新安装libsvn-java还是不灵,去usr/lib/jni发现jni不是个目录。原来是安装目录发生了改变。将jni的path改为如下就正常了。</p>
<p>-Djava.library.path=/usr/lib/x86_64-linux-gnu/jni/<br />
	&#160;</p>
<p>参考资料http://pkgs.org/ubuntu-12.04/ubuntu-universe-amd64/libsvn-java_1.6.17dfsg-3ubuntu3_amd64.deb.html</p>]]></description>
			<content:encoded><![CDATA[<p>Failed to load JavaHL Library.<br />
	These are the errors that were encountered:<br />
	no libsvnjavahl-1 in java.library.path<br />
	no svnjavahl-1 in java.library.path<br />
	no svnjavahl in java.library.path<br />
	java.library.path = /usr/lib/jni</p>
<p>按照以前的装法</p>
<p>1、sudo apt-get install libsvn-java</p>
<p>2、eclipse.ini中增加参数</p>
<p>-vmargs<br />
	-Dosgi.requiredJavaVersion=1.5<br />
	-Djava.library.path=/usr/lib/jni</p>
<p>就可以了,但安装配置好后还是报错Failed to load JavaHL Library.重新安装libsvn-java还是不灵,去usr/lib/jni发现jni不是个目录。原来是安装目录发生了改变。将jni的path改为如下就正常了。</p>
<p>-Djava.library.path=/usr/lib/x86_64-linux-gnu/jni/<br />
	&nbsp;</p>
<p>参考资料http://pkgs.org/ubuntu-12.04/ubuntu-universe-amd64/libsvn-java_1.6.17dfsg-3ubuntu3_amd64.deb.html</p>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创文章，转载请注明：</strong> 转载自<a href="http://blog.ziki.cn/">海波无痕</a></p>
<p><strong>本文链接地址:</strong> <a href="http://blog.ziki.cn/975.html">ubuntu 12.04 LTS 版eclipse svn报Failed to load JavaHL Library</a></p>
</div>
<p style="margin-top: 0; margin-bottom: 15px; color: #888888; font-size: 80%; font-style: italic">文章的脚注信息由WordPress的<a href="http://easwy.com/blog/wordpress/wp-posturl/" style="color: #8888FF; text-decoration: underline;">wp-posturl插件</a>自动生成</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ziki.cn/975.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>run multiple instances of sshd on ubuntu</title>
		<link>http://blog.ziki.cn/968.html</link>
		<comments>http://blog.ziki.cn/968.html#comments</comments>
		<pubDate>Fri, 06 Apr 2012 08:51:32 +0000</pubDate>
		<dc:creator>ziki</dc:creator>
				<category><![CDATA[server]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[sshd]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.ziki.cn/?p=968</guid>
		<description><![CDATA[<p>sudo cp -r /etc/ssh /etc/ssh2<br />
	sudo cp /etc/init.d/ssh /etc/init.d/ssh2<br />
	sudo cp /etc/default/ssh /etc/default/ssh2<br />
	sudo ln /usr/sbin/sshd /usr/sbin/sshd2<br />
	<br />
	<br />
	sudo vi /etc/init.d/ssh2<br />
	SSHD_OPTS=&#39;-f /etc/ssh2/sshd_config&#39;<br />
	<br />
	<br />
	sudo vi /etc/ssh2/sshd_config&#39;<br />
	<br />
	Port 28222<br />
	PidFile /var/run/sshd2.pid<br />
	HostKey /etc/ssh2/ssh_host_rsa_key<br />
	HostKey /etc/ssh2/ssh_host_dsa_key<br />
	HostKey /etc/ssh2/ssh_host_ecdsa_key<br />
	<br />
	<br />
	ssh-keygen -b 1024 -t rsa -f /etc/ssh2/ssh_host_key;<br />
	ssh-keygen -b 1024 -t rsa -f /etc/ssh2/ssh_host_rsa_key;<br />
	ssh-keygen -b 1024 -t dsa -f /etc/ssh2/ssh_host_dsa_key;<br />
	<br />
	<br />
	参考资料<br />
	http://ubuntuforums.org/showthread.php?t=1497376</p>]]></description>
			<content:encoded><![CDATA[<p>sudo cp -r /etc/ssh /etc/ssh2<br />
	sudo cp /etc/init.d/ssh /etc/init.d/ssh2<br />
	sudo cp /etc/default/ssh /etc/default/ssh2<br />
	sudo ln /usr/sbin/sshd /usr/sbin/sshd2</p>
<p>
	sudo vi /etc/init.d/ssh2<br />
	SSHD_OPTS=&#39;-f /etc/ssh2/sshd_config&#39;</p>
<p>
	sudo vi /etc/ssh2/sshd_config&#39;</p>
<p>	Port 28222<br />
	PidFile /var/run/sshd2.pid<br />
	HostKey /etc/ssh2/ssh_host_rsa_key<br />
	HostKey /etc/ssh2/ssh_host_dsa_key<br />
	HostKey /etc/ssh2/ssh_host_ecdsa_key</p>
<p>
	ssh-keygen -b 1024 -t rsa -f /etc/ssh2/ssh_host_key;<br />
	ssh-keygen -b 1024 -t rsa -f /etc/ssh2/ssh_host_rsa_key;<br />
	ssh-keygen -b 1024 -t dsa -f /etc/ssh2/ssh_host_dsa_key;</p>
<p>
	参考资料</p>
<p>http://ubuntuforums.org/showthread.php?t=1497376</p>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创文章，转载请注明：</strong> 转载自<a href="http://blog.ziki.cn/">海波无痕</a></p>
<p><strong>本文链接地址:</strong> <a href="http://blog.ziki.cn/968.html">run multiple instances of sshd on ubuntu</a></p>
</div>
<p style="margin-top: 0; margin-bottom: 15px; color: #888888; font-size: 80%; font-style: italic">文章的脚注信息由WordPress的<a href="http://easwy.com/blog/wordpress/wp-posturl/" style="color: #8888FF; text-decoration: underline;">wp-posturl插件</a>自动生成</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ziki.cn/968.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>避免javax.xml.bind.UnmarshalException兼容一个更新的webservice</title>
		<link>http://blog.ziki.cn/961.html</link>
		<comments>http://blog.ziki.cn/961.html#comments</comments>
		<pubDate>Wed, 04 Apr 2012 13:54:28 +0000</pubDate>
		<dc:creator>ziki</dc:creator>
				<category><![CDATA[javaee]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[cxf]]></category>
		<category><![CDATA[javax.xml.bind.UnmarshalException]]></category>
		<category><![CDATA[jaxb]]></category>
		<category><![CDATA[webservices]]></category>

		<guid isPermaLink="false">http://blog.ziki.cn/?p=961</guid>
		<description><![CDATA[<p>CXF的jaxb客户端调用webservice的情况下，默认情况下服务端更新了wsdl如xml增加了一个属性,假如不再根据wsdl重新生成client就会报错&#160;javax.xml.bind.UnmarshalException: unexpected element ，但新增的这个元素对原有的业务又是无用的多余的。</p>
<p>那对于客户端来说就可以不升级client，解决办法是将set-jaxb-validation-event-handler 设置为false</p>
<p>JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();</p>
<div>Class clazz = MyService.class;</div>
<div>List&#60;Interceptor&#62; interceptors = new ArrayList&#60;Interceptor&#62;();</div>
<div>factory.setAddress(&#34;http://localhost:8080/MyService?wsdl&#34;);</div>
<div>factory.setServiceClass(clazz);</div>
<div>if(factory.getProperties()==null){</div>
<div>Map&#60;String, Object&#62; properties = new HashMap&#60;String,Object&#62;();</div>
<div>factory.setProperties(properties);</div>
<div>}</div>
<div>factory.getProperties().put(&#34;set-jaxb-validation-event-handler&#34;, &#34;false&#34;);</div>
<div>client = (MyService)factory.create();</div>
<p>参考资料</p>
<p>http://cxf.547215.n5.nabble.com/How-to-deal-with-an-updated-WSDL-td552046.html</p>
<p><a href="http://stackoverflow.com/questions/2195034/server-side-xml-validation-with-cxf-webservice">http://stackoverflow.com/questions/2195034/server-side-xml-validation-with-cxf-webservice</a></p>]]></description>
			<content:encoded><![CDATA[<p>CXF的jaxb客户端调用webservice的情况下，默认情况下服务端更新了wsdl如xml增加了一个属性,假如不再根据wsdl重新生成client就会报错&nbsp;javax.xml.bind.UnmarshalException: unexpected element ，但新增的这个元素对原有的业务又是无用的多余的。</p>
<p>那对于客户端来说就可以不升级client，解决办法是将set-jaxb-validation-event-handler 设置为false</p>
<p>JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();</p>
<div>Class clazz = MyService.class;</div>
<div>List&lt;Interceptor&gt; interceptors = new ArrayList&lt;Interceptor&gt;();</div>
<div>factory.setAddress(&quot;http://localhost:8080/MyService?wsdl&quot;);</div>
<div>factory.setServiceClass(clazz);</div>
<div>if(factory.getProperties()==null){</div>
<div>Map&lt;String, Object&gt; properties = new HashMap&lt;String,Object&gt;();</div>
<div>factory.setProperties(properties);</div>
<div>}</div>
<div>factory.getProperties().put(&quot;set-jaxb-validation-event-handler&quot;, &quot;false&quot;);</div>
<div>client = (MyService)factory.create();</div>
<p>参考资料</p>
<p>http://cxf.547215.n5.nabble.com/How-to-deal-with-an-updated-WSDL-td552046.html</p>
<p><a href="http://stackoverflow.com/questions/2195034/server-side-xml-validation-with-cxf-webservice">http://stackoverflow.com/questions/2195034/server-side-xml-validation-with-cxf-webservice</a></p>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创文章，转载请注明：</strong> 转载自<a href="http://blog.ziki.cn/">海波无痕</a></p>
<p><strong>本文链接地址:</strong> <a href="http://blog.ziki.cn/961.html">避免javax.xml.bind.UnmarshalException兼容一个更新的webservice</a></p>
</div>
<p style="margin-top: 0; margin-bottom: 15px; color: #888888; font-size: 80%; font-style: italic">文章的脚注信息由WordPress的<a href="http://easwy.com/blog/wordpress/wp-posturl/" style="color: #8888FF; text-decoration: underline;">wp-posturl插件</a>自动生成</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ziki.cn/961.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cxf自动生成的wsdl被nginx代理后soap:address location</title>
		<link>http://blog.ziki.cn/957.html</link>
		<comments>http://blog.ziki.cn/957.html#comments</comments>
		<pubDate>Sat, 31 Mar 2012 01:46:00 +0000</pubDate>
		<dc:creator>ziki</dc:creator>
				<category><![CDATA[javaee]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[cxf]]></category>
		<category><![CDATA[jaxws]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[soap]]></category>
		<category><![CDATA[tomcat]]></category>
		<category><![CDATA[webservices]]></category>
		<category><![CDATA[wsdl]]></category>

		<guid isPermaLink="false">http://blog.ziki.cn/?p=957</guid>
		<description><![CDATA[<p>由于开发webservice使用的是cxf的java first、wsdl是自动生成的。其中生成的</p>
<p><span style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">&#60;wsdl:port</span><span class="webkit-html-attribute" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">&#160;<span class="webkit-html-attribute-name">binding</span>=&#34;<span class="webkit-html-attribute-value">tns:MyServiceSoapBinding</span>&#34;</span><span class="webkit-html-attribute" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">&#160;<span class="webkit-html-attribute-name">name</span>=&#34;My<span class="webkit-html-attribute-value">ServicePort</span>&#34;</span><span style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">&#62;</span></p>
<p><span style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">&#60;soap12:address</span><span class="webkit-html-attribute" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">&#160;<span class="webkit-html-attribute-name">location</span>=&#34;<span class="webkit-html-attribute-value">http://www.domain.com/appcontext/Service/MyService</span>&#34;</span><span style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">/&#62;</span></p>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; "><span class="webkit-html-tag">&#60;/wsdl:port&#62;</span></div>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">&#160;</div>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">location 是根据请求的request来自动生成的</div>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">如果用127.0.0.1来访问生成的wsdl就是</div>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">
	<div class="line"><span class="webkit-html-tag">&#60;wsdl:port<span class="webkit-html-attribute">&#160;<span class="webkit-html-attribute-name">binding</span>=&#34;tns:MyServiceSoapBinding&#34;</span><span class="webkit-html-attribute">&#160;<span class="webkit-html-attribute-name">name</span>=&#34;My<span class="webkit-html-attribute-value">ServicePort</span>&#34;</span>&#62;</span></div>
	<div class="collapsible-content" style="margin-left: 1em; ">
		<div class="line"><span class="webkit-html-tag">&#60;soap12:address<span class="webkit-html-attribute">&#160;<span class="webkit-html-attribute-name">location</span>=&#34;<span class="webkit-html-attribute-value">http://127.0.0.1/appcontext/Service/MyService</span>&#34;</span>/&#62;</span>&#60;/wsdl:port&#62;</div>
	</div>
	<div class="line">如果用localhost来访问生成的wsdl就是</div>
	<div class="line">
		<div class="line"><span class="webkit-html-tag">&#60;wsdl:port<span class="webkit-html-attribute">&#160;<span class="webkit-html-attribute-name">binding</span>=&#34;tns:MyServiceSoapBinding&#34;</span><span class="webkit-html-attribute">&#160;<span class="webkit-html-attribute-name">name</span>=&#34;My<span class="webkit-html-attribute-value">ServicePort</span>&#34;</span>&#62;</span></div>
		<div class="collapsible-content" style="margin-left: 1em; ">
			<div class="line"><span class="webkit-html-tag">&#60;soap12:address<span class="webkit-html-attribute">&#160;<span class="webkit-html-attribute-name">location</span>=&#34;<span class="webkit-html-attribute-value">http://localhost/appcontext/Service/MyService</span>&#34;</span>/&#62;</span></div>
			<div class="line">&#60;/wsdl:port&#62;</div>
		</div>
		<p>这就会产生一个问题如果用nginx或者apache放在tomcat的前端的话,tomcat获取的request是内网的地址</p>
	</div>
</div>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">比如访问nginx的</div>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">www.domain.com---&#62;用nginxproxy到 nginxserver所在的内网地址是localhost:8080</div>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">那么动态生成的wsdl</div>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">就变成了</div>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">
	<div class="line"><span class="webkit-html-tag">&#60;wsdl:port<span class="webkit-html-attribute">&#160;<span class="webkit-html-attribute-name">binding</span>=&#34;tns:MyServiceSoapBinding&#34;</span><span class="webkit-html-attribute">&#160;<span class="webkit-html-attribute-name">name</span>=&#34;My<span class="webkit-html-attribute-value">ServicePort</span>&#34;</span>&#62;</span></div>
	<div class="collapsible-content" style="margin-left: 1em; ">
		<div class="line"><span class="webkit-html-tag">&#60;soap12:address<span class="webkit-html-attribute">&#160;<span class="webkit-html-attribute-name">location</span>=&#34;<span class="webkit-html-attribute-value">http://localhost:8080/appcontext/Service/MyService</span>&#34;</span>/&#62;</span></div>
		<p>&#60;/wsdl:port&#62;</p>
	</div>
</div>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">这将导致wsdl的不准确。</div>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">&#160;</div>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">解决办法是用publishedEndpointUrl参数来明确这个location的地址</div>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">如下</div>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">&#160;</div>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">
	<div>&#60;jaxws:endpoint implementor=&#34;#MyServiceEndpoint&#34; address=&#34;/MyService&#34; publishedEndpointUrl=&#34;http://www.domain.com/appcontext/Service/MyService&#34;&#62;</div>
	<div>&#60;jaxws:binding&#62;</div>
	<div>&#60;soap:soapBinding version=&#34;1.2&#34; /&#62;</div>
	<div>&#60;/jaxws:binding&#62;</div>
	<div>&#60;jaxws:dataBinding&#62;</div>
	<div>&#60;bean class=&#34;org.apache.cxf.jaxb.JAXBDataBinding&#34;/&#62;</div>
	<div>&#60;/jaxws:dataBinding&#62;</div>
	<div>&#60;/jaxws:endpoint&#62;</div>
</div>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">&#160;</div>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">&#160;</div>]]></description>
			<content:encoded><![CDATA[<p>由于开发webservice使用的是cxf的java first、wsdl是自动生成的。其中生成的</p>
<p><span style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">&lt;wsdl:port</span><span class="webkit-html-attribute" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">&nbsp;<span class="webkit-html-attribute-name">binding</span>=&quot;<span class="webkit-html-attribute-value">tns:MyServiceSoapBinding</span>&quot;</span><span class="webkit-html-attribute" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">&nbsp;<span class="webkit-html-attribute-name">name</span>=&quot;My<span class="webkit-html-attribute-value">ServicePort</span>&quot;</span><span style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">&gt;</span></p>
<p><span style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">&lt;soap12:address</span><span class="webkit-html-attribute" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">&nbsp;<span class="webkit-html-attribute-name">location</span>=&quot;<span class="webkit-html-attribute-value">http://www.domain.com/appcontext/Service/MyService</span>&quot;</span><span style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">/&gt;</span></p>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; "><span class="webkit-html-tag">&lt;/wsdl:port&gt;</span></div>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">&nbsp;</div>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">location 是根据请求的request来自动生成的</div>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">如果用127.0.0.1来访问生成的wsdl就是</div>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">
<div class="line"><span class="webkit-html-tag">&lt;wsdl:port<span class="webkit-html-attribute">&nbsp;<span class="webkit-html-attribute-name">binding</span>=&quot;tns:MyServiceSoapBinding&quot;</span><span class="webkit-html-attribute">&nbsp;<span class="webkit-html-attribute-name">name</span>=&quot;My<span class="webkit-html-attribute-value">ServicePort</span>&quot;</span>&gt;</span></div>
<div class="collapsible-content" style="margin-left: 1em; ">
<div class="line"><span class="webkit-html-tag">&lt;soap12:address<span class="webkit-html-attribute">&nbsp;<span class="webkit-html-attribute-name">location</span>=&quot;<span class="webkit-html-attribute-value">http://127.0.0.1/appcontext/Service/MyService</span>&quot;</span>/&gt;</span>&lt;/wsdl:port&gt;</div>
</p></div>
<div class="line">如果用localhost来访问生成的wsdl就是</div>
<div class="line">
<div class="line"><span class="webkit-html-tag">&lt;wsdl:port<span class="webkit-html-attribute">&nbsp;<span class="webkit-html-attribute-name">binding</span>=&quot;tns:MyServiceSoapBinding&quot;</span><span class="webkit-html-attribute">&nbsp;<span class="webkit-html-attribute-name">name</span>=&quot;My<span class="webkit-html-attribute-value">ServicePort</span>&quot;</span>&gt;</span></div>
<div class="collapsible-content" style="margin-left: 1em; ">
<div class="line"><span class="webkit-html-tag">&lt;soap12:address<span class="webkit-html-attribute">&nbsp;<span class="webkit-html-attribute-name">location</span>=&quot;<span class="webkit-html-attribute-value">http://localhost/appcontext/Service/MyService</span>&quot;</span>/&gt;</span></div>
<div class="line">&lt;/wsdl:port&gt;</div>
</p></div>
<p>这就会产生一个问题如果用nginx或者apache放在tomcat的前端的话,tomcat获取的request是内网的地址</p>
</p></div>
</div>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">比如访问nginx的</div>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">www.domain.com---&gt;用nginxproxy到 nginxserver所在的内网地址是localhost:8080</div>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">那么动态生成的wsdl</div>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">就变成了</div>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">
<div class="line"><span class="webkit-html-tag">&lt;wsdl:port<span class="webkit-html-attribute">&nbsp;<span class="webkit-html-attribute-name">binding</span>=&quot;tns:MyServiceSoapBinding&quot;</span><span class="webkit-html-attribute">&nbsp;<span class="webkit-html-attribute-name">name</span>=&quot;My<span class="webkit-html-attribute-value">ServicePort</span>&quot;</span>&gt;</span></div>
<div class="collapsible-content" style="margin-left: 1em; ">
<div class="line"><span class="webkit-html-tag">&lt;soap12:address<span class="webkit-html-attribute">&nbsp;<span class="webkit-html-attribute-name">location</span>=&quot;<span class="webkit-html-attribute-value">http://localhost:8080/appcontext/Service/MyService</span>&quot;</span>/&gt;</span></div>
<p>&lt;/wsdl:port&gt;</p>
</p></div>
</div>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">这将导致wsdl的不准确。</div>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">&nbsp;</div>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">解决办法是用publishedEndpointUrl参数来明确这个location的地址</div>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">如下</div>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">&nbsp;</div>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">
<div>&lt;jaxws:endpoint implementor=&quot;#MyServiceEndpoint&quot; address=&quot;/MyService&quot; publishedEndpointUrl=&quot;http://www.domain.com/appcontext/Service/MyService&quot;&gt;</div>
<div>&lt;jaxws:binding&gt;</div>
<div>&lt;soap:soapBinding version=&quot;1.2&quot; /&gt;</div>
<div>&lt;/jaxws:binding&gt;</div>
<div>&lt;jaxws:dataBinding&gt;</div>
<div>&lt;bean class=&quot;org.apache.cxf.jaxb.JAXBDataBinding&quot;/&gt;</div>
<div>&lt;/jaxws:dataBinding&gt;</div>
<div>&lt;/jaxws:endpoint&gt;</div>
</div>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">&nbsp;</div>
<div class="line" style="color: rgb(0, 0, 0); font-family: monospace; font-size: 13px; ">&nbsp;</div>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创文章，转载请注明：</strong> 转载自<a href="http://blog.ziki.cn/">海波无痕</a></p>
<p><strong>本文链接地址:</strong> <a href="http://blog.ziki.cn/957.html">cxf自动生成的wsdl被nginx代理后soap:address location</a></p>
</div>
<p style="margin-top: 0; margin-bottom: 15px; color: #888888; font-size: 80%; font-style: italic">文章的脚注信息由WordPress的<a href="http://easwy.com/blog/wordpress/wp-posturl/" style="color: #8888FF; text-decoration: underline;">wp-posturl插件</a>自动生成</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ziki.cn/957.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>tomcat在windows下安装后台服务</title>
		<link>http://blog.ziki.cn/954.html</link>
		<comments>http://blog.ziki.cn/954.html#comments</comments>
		<pubDate>Thu, 29 Mar 2012 13:22:34 +0000</pubDate>
		<dc:creator>ziki</dc:creator>
				<category><![CDATA[javaee]]></category>
		<category><![CDATA[tomcat]]></category>
		<category><![CDATA[windows service]]></category>

		<guid isPermaLink="false">http://blog.ziki.cn/?p=954</guid>
		<description><![CDATA[<p>1、用命令行进入tomcat_home/bin/目录,运行service install tomcat_c4。进入服务列表设置为自动服务。</p>
<p>2、使用regedit进入注册表</p>
<p>找到</p>
<p>HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Procrun 2.0\tomcat_c4\Parameters\Java</p>
<p>修改</p>
<p>JvmMs&#160;选10进制 设置为512&#160;</p>
<p>JvmMx 选10进制 设置为512</p>
<p>Options 的值增加</p>
<p>&#160;</p>
<div>-XX:NewRatio=3</div>
<div>-XX:PermSize=128m</div>
<div>-XX:MaxPermSize=256m</div>
<div>-XX:MaxDirectMemorySize=128m</div>
<div>-Duser.country=US</div>
<div>-Duser.language=en</div>
<div>-Duser.timezone=Asia/Shanghai</div>
<div>-Dfile.encoding=utf-8</div>
<div>-Dsun.jnu.encoding=utf-8</div>
<div>-Dcom.sun.management.jmxremote=true</div>
<p>&#160;</p>
<p>server.xml配置</p>
<p>&#160;</p>
<p>&#160;</p>
<div>&#60;Executor name=&#34;tomcatThreadPool&#34; namePrefix=&#34;catalina-exec-&#34; maxThreads=&#34;500&#34; minSpareThreads=&#34;100&#34; prestartminSpareThreads=&#34;false&#34;/&#62;</div>
<div>&#60;Connector executor=&#34;tomcatThreadPool&#34; port=&#34;8092&#34; protocol=&#34;org.apache.coyote.http11.Http11AprProtocol&#34; connectionTimeout=&#34;10000&#34; redirectPort=&#34;8443&#34; enableLookups=&#34;false&#34;/&#62;</div>
<div>&#60;Connector executor=&#34;tomcatThreadPool&#34; port=&#34;8209&#34; protocol=&#34;org.apache.coyote.ajp.AjpAprProtocol&#34; connectionTimeout=&#34;20000&#34; keepAliveTimeout=&#34;30000&#34; &#160;redirectPort=&#34;8443&#34; acceptorThreadCount=&#34;1&#34; acceptCount=&#34;500&#34;/&#62;</div>
<div>&#160;</div>]]></description>
			<content:encoded><![CDATA[<p>1、用命令行进入tomcat_home/bin/目录,运行service install tomcat_c4。进入服务列表设置为自动服务。</p>
<p>2、使用regedit进入注册表</p>
<p>找到</p>
<p>HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Procrun 2.0\tomcat_c4\Parameters\Java</p>
<p>修改</p>
<p>JvmMs&nbsp;选10进制 设置为512&nbsp;</p>
<p>JvmMx 选10进制 设置为512</p>
<p>Options 的值增加</p>
<p>&nbsp;</p>
<div>-XX:NewRatio=3</div>
<div>-XX:PermSize=128m</div>
<div>-XX:MaxPermSize=256m</div>
<div>-XX:MaxDirectMemorySize=128m</div>
<div>-Duser.country=US</div>
<div>-Duser.language=en</div>
<div>-Duser.timezone=Asia/Shanghai</div>
<div>-Dfile.encoding=utf-8</div>
<div>-Dsun.jnu.encoding=utf-8</div>
<div>-Dcom.sun.management.jmxremote=true</div>
<p>&nbsp;</p>
<p>server.xml配置</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div>&lt;Executor name=&quot;tomcatThreadPool&quot; namePrefix=&quot;catalina-exec-&quot; maxThreads=&quot;500&quot; minSpareThreads=&quot;100&quot; prestartminSpareThreads=&quot;false&quot;/&gt;</div>
<div>&lt;Connector executor=&quot;tomcatThreadPool&quot; port=&quot;8092&quot; protocol=&quot;org.apache.coyote.http11.Http11AprProtocol&quot; connectionTimeout=&quot;10000&quot; redirectPort=&quot;8443&quot; enableLookups=&quot;false&quot;/&gt;</div>
<div>&lt;Connector executor=&quot;tomcatThreadPool&quot; port=&quot;8209&quot; protocol=&quot;org.apache.coyote.ajp.AjpAprProtocol&quot; connectionTimeout=&quot;20000&quot; keepAliveTimeout=&quot;30000&quot; &nbsp;redirectPort=&quot;8443&quot; acceptorThreadCount=&quot;1&quot; acceptCount=&quot;500&quot;/&gt;</div>
<div>&nbsp;</div>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创文章，转载请注明：</strong> 转载自<a href="http://blog.ziki.cn/">海波无痕</a></p>
<p><strong>本文链接地址:</strong> <a href="http://blog.ziki.cn/954.html">tomcat在windows下安装后台服务</a></p>
</div>
<p style="margin-top: 0; margin-bottom: 15px; color: #888888; font-size: 80%; font-style: italic">文章的脚注信息由WordPress的<a href="http://easwy.com/blog/wordpress/wp-posturl/" style="color: #8888FF; text-decoration: underline;">wp-posturl插件</a>自动生成</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ziki.cn/954.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Another unnamed CacheManager already exists in the same VM.</title>
		<link>http://blog.ziki.cn/950.html</link>
		<comments>http://blog.ziki.cn/950.html#comments</comments>
		<pubDate>Wed, 21 Mar 2012 15:02:47 +0000</pubDate>
		<dc:creator>ziki</dc:creator>
				<category><![CDATA[javaee]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[CacheManager]]></category>
		<category><![CDATA[ehcache]]></category>
		<category><![CDATA[hibernate]]></category>

		<guid isPermaLink="false">http://blog.ziki.cn/?p=950</guid>
		<description><![CDATA[<div><span style="color: rgb(51, 51, 51); font-family: Georgia, 'Bitstream Charter', serif; font-size: 16px; line-height: 24px; ">ehcache版本2.5.1</span></div>
<div>&#160;</div>
<div>nested exception is net.sf.ehcache.CacheException: Another unnamed CacheManager already exists in the same VM. Please provide unique names for each CacheManager in the config or do one of following:</div>
<div>1. Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or create one if necessary</div>
<div>2. Shutdown the earlier cacheManager before creating new one with same name.</div>
<div>The source of the existing CacheManager is: DefaultConfigurationSource [ ehcache.xml or ehcache-failsafe.xml ]</div>
<div>at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:389)</div>
<div>at org.springframework.web.context.ContextLoader.loadParentContext(ContextLoader.java:358)</div>
<div>at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:193)</div>
<div>at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)</div>
<div>at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)</div>
<div>at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)</div>
<div>at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)</div>
<div>at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)</div>
<div>at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)</div>
<div>at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)</div>
<div>at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:649)</div>
<div>at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1581)</div>
<div>at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)</div>
<div>at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)</div>
<div>at java.util.concurrent.FutureTask.run(FutureTask.java:138)</div>
<div>at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)</div>
<div>at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)</div>
<div>at java.lang.Thread.run(Thread.java:662)</div>
<div>&#160;</div>
<div>&#160;</div>
<div>
	<div>&#60;bean id=sessionFactory&#34; class=&#34;org.springframework.orm.hibernate3.LocalSessionFactoryBean&#34; lazy-init=&#34;true&#34;&#62;</div>
	<div>&#60;property name=&#34;dataSource&#34;&#62;&#60;ref bean=&#34;dataSource&#34; /&#62;&#60;/property&#62;</div>
	<div>&#60;property name=&#34;mappingLocations&#34;&#62;</div>
	<div>&#60;list&#62;&#60;value&#62;classpath*:com/xxx/*.hbm.xml&#60;/value&#62;&#60;/list&#62;</div>
	<div>&#60;/property&#62;</div>
	<div>&#60;property name=&#34;hibernateProperties&#34;&#62;</div>
	<div>&#60;value&#62;</div>
	<div>hibernate.bytecode.use_reflection_optimizer={hibernate.bytecode.use_reflection_optimizer}</div>
	<div>hibernate.dialect=${hibernate.dialect}</div>
	<div>hibernate.jdbc.fetch_size=${hibernate.jdbc.fetch_size}</div>
	<div>hibernate.jdbc.batch_size=${hibernate.jdbc.batch_size}</div>
	<div>hibernate.hbm2ddl.auto=${hibernate.hbm2ddl.auto}</div>
	<div>hibernate.show_sql=${hibernate.show_sql}</div>
	<div>hibernate.format_sql=${hibernate.format_sql}</div>
	<div>hibernate.query.factory_class=${hibernate.query.factory_class}</div>
	<div>hibernate.default_batch_fetch_size=${hibernate.default_batch_fetch_size}</div>
	<div>hibernate.transaction.factory_class=${hibernate.transaction.factory_class}</div>
	<div>hibernate.transaction.auto_close_session=${hibernate.transaction.auto_close_session}</div>
	<div>hibernate.cache.use_query_cache=${hibernate.cache.use_query_cache}</div>
	<div>hibernate.cache.use_second_level_cache=${hibernate.cache.use_second_level_cache}</div>
	<div>
		<div>hibernate.cache.region.factory_class=net.sf.ehcache.hibernate.SingletonEhCacheRegionFactory</div>
		<div>net.sf.ehcache.configurationResourceName=/com/xxx/ehcache.xml</div>
		<p>&#160;</p>
	</div>
	<div>&#60;/value&#62;</div>
	<div>&#60;/property&#62;</div>
	<div>&#60;/bean&#62;<span class="Apple-tab-span" style="white-space:pre"> </span></div>
	<div>&#160;</div>
	<div>用个项目中多个sessionfactory使用hibernate的ehcache或者hibernate和业务共同使用ehcache使用SingletonEhCacheRegionFactory。</div>
</div>
<div>&#160;</div>]]></description>
			<content:encoded><![CDATA[<div><span style="color: rgb(51, 51, 51); font-family: Georgia, 'Bitstream Charter', serif; font-size: 16px; line-height: 24px; ">ehcache版本2.5.1</span></div>
<div>&nbsp;</div>
<div>nested exception is net.sf.ehcache.CacheException: Another unnamed CacheManager already exists in the same VM. Please provide unique names for each CacheManager in the config or do one of following:</div>
<div>1. Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or create one if necessary</div>
<div>2. Shutdown the earlier cacheManager before creating new one with same name.</div>
<div>The source of the existing CacheManager is: DefaultConfigurationSource [ ehcache.xml or ehcache-failsafe.xml ]</div>
<div>at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:389)</div>
<div>at org.springframework.web.context.ContextLoader.loadParentContext(ContextLoader.java:358)</div>
<div>at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:193)</div>
<div>at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)</div>
<div>at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)</div>
<div>at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)</div>
<div>at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)</div>
<div>at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)</div>
<div>at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)</div>
<div>at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)</div>
<div>at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:649)</div>
<div>at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1581)</div>
<div>at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)</div>
<div>at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)</div>
<div>at java.util.concurrent.FutureTask.run(FutureTask.java:138)</div>
<div>at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)</div>
<div>at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)</div>
<div>at java.lang.Thread.run(Thread.java:662)</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>
<div>&lt;bean id=sessionFactory&quot; class=&quot;org.springframework.orm.hibernate3.LocalSessionFactoryBean&quot; lazy-init=&quot;true&quot;&gt;</div>
<div>&lt;property name=&quot;dataSource&quot;&gt;&lt;ref bean=&quot;dataSource&quot; /&gt;&lt;/property&gt;</div>
<div>&lt;property name=&quot;mappingLocations&quot;&gt;</div>
<div>&lt;list&gt;&lt;value&gt;classpath*:com/xxx/*.hbm.xml&lt;/value&gt;&lt;/list&gt;</div>
<div>&lt;/property&gt;</div>
<div>&lt;property name=&quot;hibernateProperties&quot;&gt;</div>
<div>&lt;value&gt;</div>
<div>hibernate.bytecode.use_reflection_optimizer={hibernate.bytecode.use_reflection_optimizer}</div>
<div>hibernate.dialect=${hibernate.dialect}</div>
<div>hibernate.jdbc.fetch_size=${hibernate.jdbc.fetch_size}</div>
<div>hibernate.jdbc.batch_size=${hibernate.jdbc.batch_size}</div>
<div>hibernate.hbm2ddl.auto=${hibernate.hbm2ddl.auto}</div>
<div>hibernate.show_sql=${hibernate.show_sql}</div>
<div>hibernate.format_sql=${hibernate.format_sql}</div>
<div>hibernate.query.factory_class=${hibernate.query.factory_class}</div>
<div>hibernate.default_batch_fetch_size=${hibernate.default_batch_fetch_size}</div>
<div>hibernate.transaction.factory_class=${hibernate.transaction.factory_class}</div>
<div>hibernate.transaction.auto_close_session=${hibernate.transaction.auto_close_session}</div>
<div>hibernate.cache.use_query_cache=${hibernate.cache.use_query_cache}</div>
<div>hibernate.cache.use_second_level_cache=${hibernate.cache.use_second_level_cache}</div>
<div>
<div>hibernate.cache.region.factory_class=net.sf.ehcache.hibernate.SingletonEhCacheRegionFactory</div>
<div>net.sf.ehcache.configurationResourceName=/com/xxx/ehcache.xml</div>
<p>&nbsp;</p>
</p></div>
<div>&lt;/value&gt;</div>
<div>&lt;/property&gt;</div>
<div>&lt;/bean&gt;<span class="Apple-tab-span" style="white-space:pre"> </span></div>
<div>&nbsp;</div>
<div>用个项目中多个sessionfactory使用hibernate的ehcache或者hibernate和业务共同使用ehcache使用SingletonEhCacheRegionFactory。</div>
</div>
<div>&nbsp;</div>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创文章，转载请注明：</strong> 转载自<a href="http://blog.ziki.cn/">海波无痕</a></p>
<p><strong>本文链接地址:</strong> <a href="http://blog.ziki.cn/950.html">Another unnamed CacheManager already exists in the same VM.</a></p>
</div>
<p style="margin-top: 0; margin-bottom: 15px; color: #888888; font-size: 80%; font-style: italic">文章的脚注信息由WordPress的<a href="http://easwy.com/blog/wordpress/wp-posturl/" style="color: #8888FF; text-decoration: underline;">wp-posturl插件</a>自动生成</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ziki.cn/950.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

