首页 > 学院 > 开发设计 > 正文

MapReduce初体验

2019-11-08 02:50:41
字体:
来源:转载
供稿:网友

首先跑一下Hadoop自己带的world count。

先得上传文件到HDFS。

hadoop fs -mkdir -p /Wordcount/inputhadoop fs -put GitHubLog.txt /wordcount/input

然后运行

hadoop jar /root/apps/hadoop-2.7.3/share/hadoop/maPReduce/hadoop-mapreduce-examples-2.7.3.jar wordcount /wordcount/input/ /wordcount/output

其中 /wordcount/output 是结果的输出目录,要求不存在。

在这一步还出了问题,结果是之前的集群没配好。之前那篇配置Hadoop的博客已经修正了。

使用下面的命令查看结果:

hadoop fs -cat /wordcount/output/part-r-00000

一部分结果是:

extracted 4failed. 2failed: 2fatal: 2fetch 1file 3file; 2filters 1find 2for 11from 4get 1git 3git.c:371 2github 1github.com 6

自己写MapReduce程序的部分的话,后续有时间再补吧。


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表