操作系统:ubuntu10.10 32bit用户:xcloudHadoop:hadoop-0.20.2-cdh3u2 (安装目录:/home/xcloud/cdh3/hadoop-0.20.2-cdh3u2)eclipse:eclipse3.7(indigo) >> eclipse3.5(galileo)编译好到eclipse plugin,eclipse3.7(indigo)版本跑不起来,抛6.错误 中a错误,更换版本为eclipse3.5(galileo)后,可正常使用。1.hadoop-eclipse-plugin源码将hadoop-eclipse-plugin源码拷贝到eclipse工程目录下源码位置:$HADOOP_HOME/src/contrib/eclipse-plugin2.build-contrib.xml拷贝$HADOOP_HOME/src/contrib/build-contrib.xml到eclipse插件工程根目录下
a.新增一属性--eclipse-home dir<property name="eclipse.home" value="/opt/eclipse"/>
b.新增属性
<property name="version" value="0.20.2-cdh3u2"/>
c.修改
<property name="hadoop.root" location="${src.contrib.dir}/../../"/>为 :
<property name="hadoop.root" location="/home/xcloud/cdh3/hadoop-0.20.2-cdh3u2/"/>
3.build.xml
a.修改<import file="../build-contrib.xml"/>为
<import file="build-contrib.xml"/>
b.修改classpath
fileset指向hadoop安装目录下到jar文件
<path id="classpath"> <pathelement location="${build.classes}"/> <pathelement location="${hadoop.root}/build/classes"/> <path refid="eclipse-sdk-jars"/> <fileset dir="/home/xcloud/cdh3/hadoop-0.20.2-cdh3u2/"> <include name="*.jar"/> </fileset> </path>
c.拷贝
sudo cp $HADOOP_HOME//ivy/ivy-2.0.0-rc2.jar /home/xcloud/cdh3/sudo cp $HADOOP_HOME//ivy/ivy-2.0.0-rc2.jar /home/xcloud/cdh3/
<copy file="${hadoop.root}/build/hadoop-core-${version}.jar" tofile="${build.dir}/lib/hadoop-core.jar" verbose="true"/> <copy file="${hadoop.root}/build/ivy/lib/Hadoop/common/commons-cli-${commons-cli.version}.jar" todir="${build.dir}/lib" verbose="true"/>
为
<copy file="/home/xcloud/cdh3/hadoop-core-${version}.jar" tofile="${build.dir}/lib/hadoop-core.jar" verbose="true"/> <copy file="/home/xcloud/cdh3/ivy-2.0.0-rc2.jar" tofile="${build.dir}/lib/commons-cli-${commons-cli.version}.jar" verbose="true"/>
4.ant build
/home/xcloud/cdh3/hadoop-0.20.2-cdh3u2/build/contrib/eclipse-plugin/hadoop-eclipse-plugin-0.20.2-cdh3u2.jar cp $HADOOP_HOME/build/contrib/eclipse-plugin/hadoop-eclipse-plugin-0.20.2-cdh3u2.jar $ECLIPSE_HOME/plugins
5.打开eclipse进行hadoop目录,相关配置设置
6.错误
a.2011-12-30 15:06:38,604 WARN org.apache.hadoop.ipc.Server: Incorrect header or version mismatch from 10.45.46.123:44614 got version 3 expected version 4无解!
后更换eclipse版本为eclipse-jee-galileo-linux-gtk.tar.gz 一切正常起来,估计跟eclipse版本有关系。
eclipse-jee-indigo-linux-gtk.tar.gz
b.An internal error occurred during: "Map/Reduce location status updater".
org/codehaus/jackson/map/JsonMappingException,暂时不影响使用。
参考: http://heipark.iteye.com/blog/1178756