hadoop运行简单例子--单词统计
前提是已经搭建好了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
查看统计结果: