HADOOP eclipse 插件 linux下编译
12 March 2013
author : xiajun
1.首先安装JDK,和ant
2.将eclipse的plugins目录拷贝到 /home/hadoop/eclipse/plugins (注:eclipse只需要plugins目录就好了)
3.在hadoop解压目录/home/hadoop/hadoop-1.1.1/,找到src\contrib\eclipse-plugin\build.xml
4.找到src\contrib\build-contrib.xml,添加以下几行:
5.找到MANIFEST.MF,编辑classpath:加如以下几个jar
Bundle-ClassPath: classes/,
lib/hadoop-core.jar,
lib/commons-cli-1.2.jar,
lib/commons-configuration-1.6.jar,
lib/commons-httpclient-3.0.1.jar,
lib/commons-lang-2.4.jar,
lib/jackson-core-asl-1.8.8.jar,
lib/jackson-mapper-asl-1.8.8.jar 6.进入目录hadoop-1.1.1\src\contrib\eclipse-plugin,然后直接输入ant回车编译
7.在hadoop-1.1.1\build\contrib\eclipse-plugin路径下找到编译好的插件。
8.这样编译是需要联网下载一些jar包的,如果有maven私服的话可做如下修改
9.再执行ant 命令 10.远程调试mapreduce 参考文档: http://zhangjie.me/eclipse-debug-hadoop/
10.1 修改mapred-site.xml 文件
mapred.child.java.opts -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
10.2 重启hadoop ,并将mapreduce程序上传至服务器 执行 ./hadoop jar xxx.jar com.xx.xxmain
10.3 为eclipse添加远程调试 Run–>debug configurations ..–>选择弹出页面左侧”remote java application”右键 new –>host 为slaves的ip port为上面的8000端口–>apply–>debug.打上断点即可调试了。
blog comments powered by Disqus