http://trac.nchc.org.tw/cloud/wiki/waue/2009/0617
这篇文章已经叙述的很不错了
采用eclipse3.3 暂时是不会有任何问题,执行run as hadoop 那个wordcount会有错误提示
09/10/09 17:17:25 WARN conf.Configuration: DEPRECATED: hadoop-site.xml found in the classpath. Usage of hadoop-site.xml is deprecated. Instead use core-site.xml, mapred-site.xml and hdfs-site.xml to override
properties of core-default.xml, mapred-default.xml and hdfs-default.xml respectively
Usage: wordcount <in> <out>
代码问题,可以暂时不用管
另外文章中给出的
JarFile="sample-0.1.jar"
MainFunc="Sample.WordCount"
LocalOutDir="/tmp/output"
all:help
jar:
jar -cvf ${JarFile} -C bin/ .
run:
hadoop jar ${JarFile} ${MainFunc} input output
clean:
hadoop fs -rmr output
output:
rm -rf ${LocalOutDir}
hadoop fs -get output ${LocalOutDir}
gedit ${LocalOutDir}/part-r-00000 &
help:
@echo "Usage:"
@echo " make jar - Build Jar File."
@echo " make clean - Clean up Output directory on HDFS."
@echo " make run - Run your MapReduce code on Hadoop."
@echo " make output - Download and show output file"
@echo " make help - Show Makefile options."
@echo " "
@echo "Example:"
@echo " make jar; make run; make output; make clean"
这个makefile很不错,复制的时候注意使用tab
然后运行编译在eclipse3.3和3.4版本都很正常
目前有几个问题就是eclipse3.4版用hadoop-0.20.0-eclipse-plugin.jar 我这边出错,读不到这个插件, 用hadoop-0.19.2-eclipse-plugin.jar的时候连接不到本地的hadoop服务
还好用我最新编译的hadoop-0.20.1-eclipse-plugin.jar 可以正常使用,不过蛮搞笑的是用了这个, 在perspective添加了MapReduce的时候那个Map/Reduce Locations不会显示出来,要手动添加, 我不知道是我个人问题,还是普遍情况
目前都可以连接到我的hadoop服务上,可以在eclipse里面查看上传文件
eclipse3.3版本我是用0.20.0的eclipse-plugin
eclipse3.4版本我是用我自己编译的0.20.1的plugin 下载hadoop-0.20.1-eclipse-plugin.jar标签:Eclipse, eclipse-plugin, hadoop, hadoop-0.20.1-eclipse-plugin.jar, Linux, Ubuntu
相关日志
相关博文
本文被鉴定了1,612次~ 由jimey发表于2009-10-09, 18:42 — 类归于: Cloud Computing,Linux 标签为Eclipse,eclipse-plugin,hadoop,hadoop-0.20.1-eclipse-plugin.jar,Linux,Ubuntu.
评论 (6)



在 的时候,出现了以下错误,请问应该怎样解决呢?谢谢博主
hadoop jar “sample-0.1.jar” “Sample.WordCount” input output
/bin/sh: hadoop: not found
make: *** [run] Error 127
回复本留言
jimey Reply:
一月 29th, 2010 at 01:05
你那127行啥错误?
回复本留言
tonia Reply:
六月 21st, 2010 at 09:36
@jimey,
Sorry, but what do you mean?
I’ve got the same error. What’s the matter?
Thanks.
回复本留言
jimey Reply:
六月 21st, 2010 at 10:42
@tonia, 应该是运行时候路径设置错误了吧?没找到hadoop/bin/里面去…去找/bin/sh去了..自然是找不到了…另外你是在啥环境下运行的?具体配置是怎么样的?
lya —— 2010-01-26 @18:25
10/08/13 09:37:03 WARN conf.Configuration: DEPRECATED: hadoop-site.xml found in the classpath. Usage of hadoop-site.xml is deprecated. Instead use core-site.xml, mapred-site.xml and hdfs-site.xml to override properties of core-default.xml, mapred-default.xml and hdfs-default.xml respectively
Usage: wordcount
这个错误是怎么回事呢?我也遇到了同样的问题,但是看了您的博客,还是不太明白。
回复本留言
jimey Reply:
八月 13th, 2010 at 13:03
@牛啃草, 可能是你参考的教程是老的.新版的hadoop已经不用hadoop-site.xml了.需要分别在core-site.xml, mapred-site.xml and hdfs-site.xml 里面设置.
回复本留言
牛啃草 —— 2010-08-13 @11:10