hadoop shell命令操作(二)

用mapreduce实现wordcount,这个代码不用我们自己写,有专门的jar包,在

/home/hadoop/apps/hadoop-2.6.5/share/hadoop/mapreduce里

hadoop-mapreduce-examples-2.6.5.jar

hadoop shell命令操作(二)

在hdfs里建个目录

hadoop shell命令操作(二)

看一下建成功没

hadoop shell命令操作(二)

hadoop shell命令操作(二)


hadoop shell命令操作(二)

把文件上传到hdfs里

hadoop shell命令操作(二)

cd /home/hadoop/apps/hadoop-2.6.5/share/hadoop/mapreduce

hadoop jar hadoop-mapreduce-examples-2.6.5.jar wordcount /wordcount/input/ /wordcount/output

hadoop shell命令操作(二)

hadoop shell命令操作(二)

计算完成了,我们看下

hadoop shell命令操作(二)

hadoop shell命令操作(二)

或者

hadoop shell命令操作(二)

看效果