Hadoop 2.5.2 eclipse plugin 编译 win7 集成
参考我的前一篇文章(ubuntu + hadoop2.5.2分布式环境配置 http://www.cnblogs.com/huligong1234/p/4136331.html)
二.windows基础环境准备
windows7(x64),jdk,ant,eclipse,hadoop
1.jdk环境配置
jdk-6u26-windows-i586.exe安装后好后配置相关JAVA_HOME环境变量,并将bin目录配置到path
2.eclipse环境配置
eclipse-standard-luna-SR1-win32.zip解压到D:\eclipse\目录下并命名eclipse-hadoop
下载地址:http://developer.eclipsesource.com/technology/epp/luna/eclipse-standard-luna-SR1-win32.zip
3.ant环境配置
apache-ant-1.9.4-bin.zip解压到D:\apache\目录下,配置环境变量ANT_HOME,并将bin目录配置到path
下载地址:http://mirror.bit.edu.cn/apache//ant/binaries/apache-ant-1.9.4-bin.zip
4.下载hadoop-2.5.2.tar.gz
http://mirror.bit.edu.cn/apache/hadoop/common/hadoop-2.5.2/hadoop-2.5.2.tar.gz
5.下载hadoop-2.5.2-src.tar.gz
http://mirror.bit.edu.cn/apache/hadoop/common/hadoop-2.5.2/hadoop-2.5.2-src.tar.gz
6.下载hadoop2x-eclipse-plugin
https://github.com/winghc/hadoop2x-eclipse-plugin
7.下载hadoop-common-2.2.0-bin
https://github.com/srccodes/hadoop-common-2.2.0-bin
分别将hadoop-2.5.2.tar.gz、hadoop-2.5.2-src.tar.gz、hadoop2x-eclipse-plugin、hadoop-common-2.2.0-bin下载解压到F:\hadoop\目录下
三、编译hadoop-eclipse-plugin-2.5.2.jar配置
1.添加环境变量HADOOP_HOME=F:\hadoop\hadoop-2.5.2\
追加环境变量path内容:%HADOOP_HOME%/bin
2.修改编译包及依赖包版本信息
修改F:\hadoop\hadoop2x-eclipse-plugin-master\ivy\libraries.properties
hadoop.version=2.5.2
jackson.version=1.9.13
3.ant编译
F:\hadoop\hadoop2x-eclipse-plugin-master\src\contrib\eclipse-plugin>
ant jar -Dversion=2.5.2 -Declipse.home=D:\eclipse\eclipse-hadoop\eclipse -Dhadoop.home=F:\hadoop\hadoop-2.5.2
编译好后hadoop-eclipse-plugin-2.5.2.jar会在F:\hadoop\hadoop2x-eclipse-plugin-master\build\contrib\eclipse-plugin目录下
找不到htrace-core-3.0.4.jar
下载htrace-core-3.0.4.jar,链接:http://mvnrepository.com/artifact/org.htrace/htrace-core/3.0.4
并将该包复制到hadoop-2.5.2/share/hadoop/common/lib/目录下
重新编译!成功!
配置:
所编译插件已经在hadoop2x-eclipse-plugin-master/build/contrib/eclipse-plugin的目录下:hadoop-eclipse-plugin-2.5.2.jar
1)将hadoop-eclipse-plugin-2.5.2.jar 复制到你的eclispe/plugins目录下,重启eclpise
2)在eclipse菜单依次点击 windows→ show view → other… ,选择“ ShowView”对话框打开,搜索框输入“map”,会找到项 “ Map/ReduceLocations ”,点击“确定”按钮
3)在“Map/Reduce Locations” Tab页 点击图标 或者在空白的地方右键,选择“New Hadoop location…”,弹出对话框“New hadoop location…”,配置如下内容:
四、eclipse环境配置
1.将编译好的hadoop-eclipse-plugin-2.5.2.jar拷贝至eclipse的plugins目录下,然后重启eclipse
2.打开菜单Window--Preference--Hadoop Map/Reduce进行配置,如下图所示:
4.配置连接Hadoop,如下图所示
文件的配置情况
位置:hdfs-site.xml 中
<property>
<name>fs.defaultFS</name>
<value>hdfs://myserver</value>
</property>
位置:dfs-site.xml中:
<property>
<name>dfs.nameservices</name>
<value>myserver</value>
</property>
<property>
<name>dfs.ha.namenodes.myserver</name>
<value>nn1,nn2</value>
</property>
<property>
<name>dfs.namenode.rpc-address.myserver.nn1</name>
<value>node1:9000</value>
</property>
<property>
<name>dfs.namenode.rpc-address.myserver.nn2</name>
<value>node2:9000</value>
</property>
dfs.datanode.ipc.address 我没有找到, (有知道的可以给我留言)
- <property>
- <name>dfs.datanode.ipc.address</name>
- <value>${local.bind.address}:50020</value>
- </property>