您的位置:首页 > 运维架构

hadoop运行简单例子--单词统计

2018-03-15 22:06 330 查看
前提是已经搭建好了Hadoop平台:如下









第一步:创建HDFS目录:

文件输入目录: hadoop fs -mkdir -p /csz/wordcount/input



第二步:新建数据文件:

myword

I thought a thought. But the thought I thought wasn't the thought I thought I thought. If the thought I thought I thought had been the thought I thought, I wouldn't have thought so much.



将文件遇到hdfs文件中:



运行wordcount程序:

./hadoop jar ../share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.3.jar wordcount /csz/wordcount/input /csz/wordcount/output





查看统计结果:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: