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行 找到 , 在第82行 找到 标签,添加和修改copy子标签标签一下内容, 也就是127行下面, 如下 ( 删除第127行
    , 添加下面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"/>
    然后找到标签 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 \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 \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 修改为实际的地址

你可能感兴趣的:(Hdoop)