用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命令操作(二)

看效果

相关文章:

  • 2021-07-14
  • 2021-12-12
  • 2022-01-13
猜你喜欢
  • 2021-10-16
  • 2021-08-21
  • 2021-09-17
  • 2021-11-02
  • 2021-08-24
相关资源
相似解决方案