eclipse远程调试hadoop需要的文件如下:
1.ANT(http://ant.apache.org/bindownload.cgi)
2.hadoop2x-eclipse-plugin-master(https://github.com/winghc/hadoop2x-eclipse-plugin)
3.hadoop2.x.x部署包(https://hadoop.apache.org/releases.html)
注意了,一定要下ee版本的,如果是氧气或其他版本,有可能配置了hadoop插件可能导致eclipse左侧的DFS locations文件夹不显示!!
5.配置java和ant
JAVA_HOME,ANT_HOME,PATH下添加%JAVA_HOME%\bin,%ANT_HOME%\bin
详细配置就不讲了。
编译hadoop-eclipse-plugin插件
1.把下载好的ant、hadoop2x-eclipse-plugin-master、hadoop2.6.5解压在自己要解压的地方。我的在E:\ant\,E:\hadoop\
2.打开命令行到hadoop2x-eclipse-plugin-master\src\contrib\eclipse-plugin下
执行ant jar -Dversion=2.6.5 -Dhadoop.version-2.6.5 -Declipse.home=E:\eclipse -Dhadoop.home=E:\hadoop\hadoop-2.6.5
在编译的过程中,我碰到2个问题。
第一个
解决办法:
1.打开hadoop2x-eclipse-plugin-master\src\contrib\eclipse\plugin\build.xml
2.找到deprecation="${javac.deprecation}",在后面添加includeAntRuntime="false",保存后再次运行。
第二个
解决办法:
1.打开hadoop2.6.5\share\hadoop\common\lib下,找到commons-collections-x.x.x.jar,看看自己下的是什么版本
2.打开hadoop2x_eclipse-plugin-master\ivy\libraries.properties文件
3.把commons-collections.version=3.2.1修改成步骤1找到的版本号我的是3.2.2
修改完后再次执行编译
编译后,hadoop-eclipse-plugin文件在hadoop2x-eclipse-plugin-master\build\contrib\eclipse-plugin\下
复制粘贴在eclipse\plugins文件夹下,启动eclipse就能看到左侧栏中有DFS locations文件夹了
注意!!!上面我说过,有些eclipse版本可能不显示DFS locations文件夹,这个问题耽误了我好几个小时,如果没有出现的朋友请换Eclipse EE版本。
eclipse远程调试hadoop
1.打开eclipse,window-preferences
2.点击Hadoop Map/Reuce,选择hadoop路径
3.window-show view-MapReduce Tools,添加Map/Reuce Locations
4.new hadoop locations
配置成功后,左边的DFS locations文件夹就会有下级菜单以及hadoop文件目录了
快试试吧~