参考了:http://www.tuicool.com/articles/qY7F3q
插件名称:hadoop2x-eclipse-plugin
1.下载并解压hadoop2.x,下载地址 http://hadoop.apache.org/releases.html#Download (我下载的是编译好的包)
2.下载并解压eclipse(我的是4.5.2版本,其他的版本类似)
3.下载hadoop2x-eclipse-plugin插件并解压自己喜欢的目录,D:\tools\hadoop2x-eclipse-plugin-master\src\contrib\eclipse-plugin为了方便表达,我暂时叫他" H2EP_HOME "
4.插件编译需要ant工具,下载地址 http://ant.apache.org/bindownload.cgi
配置好ANT_HOME环境变量,指向ant解压地址,配置PATH环境变量,增加%ANT_HOME%\bin(linux环境类似)
5.打开命令行工具,进入“H2EP_HOME”目录;
6.执行ant jar -Dversion=2.6.2 -Declipse.home=E:\eclipse-jee-mars-2-win32-x86_64\eclipse -Dhadoop.home=D:\hadoop-2.6.2\hadoop-2.6.2
eclipse.home配置成eclipse安装目录
hadoop.home配置成hadoop的解压目录
将 2.x.x 修改成对应的hadoop的版本号
7.命令行在ivy-resolve-common处卡了(如果不卡,可以跳过)
原因是找不到几个依赖包,那几个依赖包可能是换路径了,其实不需要这几个依赖包也可以
解决方案:
修改"H2EP_HOME"\src\contrib\eclipse-plugin\build.xml
找到:
<target name="compile" depends="init, ivy-retrieve-common" unless="skip.contrib">
去掉depends修改为
<target name="compile" unless="skip.contrib">
8.再次执行第6步的编译命令,会提示copy不到相关jar包的错误,
解决方案:
修改"H2EP_HOME"\ivy\libraries.properties文件,
将报错的jar包版本号跟换成与"HADOOP_HOME"\share\hadoop\common\lib下面jar对应的版本号
在最后一行添加:hadoop.version=2.6.2 (千万后面不要加空格)
9.再次执行第6步的编译命令,执行成功
在"H2EP_HOME"\build\contrib\eclipse-plugin下生成hadoop-eclipse-plugin-2.x.x.jar插件
10.将hadoop-eclipse-plugin-2.x.x.jar放到eclipse的plugins目录下,启动eclipse
11.打开window===>prefernces,找到Hadoop Map/Reduce选项卡
配置hadoop installation directory目录,指向hadoop的安装目录
12.打开window====>show view====>other,找到Map/Reduce Locations,使其显示
13.在Map/Reduce Locations中右键=====>new hadoop locations,按如下编辑即可。
DFS master : 的端口为:
/opt/hadoop-2.6.2/etc/hadoop/core-site.xml
fs.defaultFS
hdfs://qxy1 ---默认端口为8020
The name of the default file system. A URI whose
scheme and authority determine the FileSystem implementation. The
uri's scheme determines the config property (fs.SCHEME.impl) naming
the FileSystem implementation class. The uri's authority is used to
determine the host, port, etc. for a filesystem.
MR的端口为:
mapreduce.jobhistory.address
qxy1:10020
MapReduce JobHistory Server IPC host:port
主机名的IP为namenode的节点IP.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22569416/viewspace-2124613/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/22569416/viewspace-2124613/