hadoop2x-eclipse-plugin在hadoop 2.7.5下编译和在hadoop完全分布式下的使用

1. 下载plugin source code
    git clone git://github.com/winghc/hadoop2x-eclipse-plugin

2. 修改相关文件, 主要有两个,一个是 hadoop2x-eclipse-plugin-master/src/contrib/eclipse-plugin/build.xml , 第二个是 hadoop2x-eclipse-plugin-master/ivy/libraries.properties
    2.1 修改build.xml
   

  1. 在第81行 找到 <!-- Override jar target to specify manifest --> , 在第82行 找到 <target name="jar" depends="compile" unless="skip.contrib">标签,添加和修改copy子标签标签一下内容, 也就是127行下面, 如下 ( 删除第127行
    <copy file="${hadoop.home}/share/hadoop/common/lib/htrace-core-${htrace.version}.jar"  todir="${build.dir}/lib" verbose="true"/> , 添加下面3行 )
    <copy file="${hadoop.home}/share/hadoop/common/lib/htrace-core-${htrace.version}-incubating.jar"  todir="${build.dir}/lib" verbose="true"/> 
    <copy file="${hadoop.home}/share/hadoop/common/lib/servlet-api-${servlet-api.version}.jar"  todir="${build.dir}/lib" verbose="true"/> 
    <copy file="${hadoop.home}/share/hadoop/common/lib/commons-io-${commons-io.version}.jar"  todir="${build.dir}/lib" verbose="true"/>
    然后找到标签<attribute name="Bundle-ClassPath"  ( 在修改之前的配置文件 build.xml 第133行 )在齐总的value的列表中对应的添加和修改lib,如下 ( 删除第154行 lib/htrace-core-${htrace.version}.jar, 添加下面3行 )
    lib/servlet-api-${servlet-api.version}.jar,
    lib/commons-io-${commons-io.version}.jar,
    lib/htrace-core-${htrace.version}-incubating.jar"/>
    2.2 修改 hadoop2x-eclipse-plugin-master/ivy/libraries.properties        
          #hadoop.version=2.6.0    modify

          hadoop.version=2.7.5
          #commons-collections.version=3.2.1    modify
          commons-collections.version=3.2.2
          #commons-httpclient.version=3.0.1    modify
          commons-httpclient.version=3.1
         #commons-logging.version=1.0.4        modify
         commons-logging.version=1.1.3
        #commons-logging-api.version=1.0.4    modify
        commons-logging-api.version=1.1.3
       #commons-math.version=2.1    modify
       commons-math.version=3.1.1
      #commons-io.version=2.1        modify
      commons-io.version=2.4
      #hsqldb.version=1.8.0.10    modify
      hsqldb.version=2.0.0
      #htrace.version=3.0.4    modify
      htrace.version=3.1.0
jets3t.version=0.6.1    modify
jets3t.version=0.9.0
#jersey-core.version=1.8    modify
#jersey-json.version=1.8    modify
#jersey-server.version=1.8    modify
jersey-core.version=1.9
jersey-json.version=1.9
jersey-server.version=1.9
#junit.version=4.5    modify
junit.version=4.11
#slf4j-api.version=1.7.5    modify
#slf4j-log4j12.version=1.7.5    modify
slf4j-api.version=1.7.10
slf4j-log4j12.version=1.7.10
#xerces.version=1.4.4    modify
xerces.version=2.9.1

3. 编译plugin
    3.1

  1. cd <plugin folder>\src\contrib\eclipse-plugin\
    Run: ant jar -Dversion=2.7.5 -Dhadoop.version=2.7.5 -Declipse.home=C:\IES4.6.1\sdk -Dhadoop.home=C:\software\hadoop-2.7.5 -debug
  2. If any error occurs, modify the C:\IES4.6.1\workspace_yanxluo1\hadoop2x-eclipse-plugin\ivy\libraries.properties to update the library version. The libraries is located in <hadoop_home>\share\hadoop\common\lib.
  3. copy the hadoop-eclipse-plugin-2.7.5.jar from C:\IES4.6.1\workspace_yanxluo1\hadoop2x-eclipse-plugin\build\contrib\eclipse-plugin to your eclipse_home/plugins
4. Download the hadoop dll files from http://download.csdn.net/download/loliaryx/10217212

5. Copy the dll files to the %HADOOP_HOME\bin folder

6. Define the env HADOOP_HOME in the system variable, and add %HADOOP_HOME% to the PATH env

7. Start eClipse with "eclipse -clean”

8. Open Map/Reduce perspective

9. New a Map/Reduce location, the port of the Map/Reduce(V2) is to the yarn port.

10 . Edit the "Advanced parameters"
   dfs.namenode.edits.dir   dfs.datanode.data.dir 修改为实际的地址

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值