Hadoop官方wordcount示例
前面的安装准备工作准备好之后,当然要实现下大数据之入门wordcount案例
提供版本JDK1.8+Hadoop2.7.2
| [root@hadoop101 hadoop-2.7.2]$mkdir input
|
| [root@hadoop101 hadoop-2.7.2]cd input [root@hadoop101 input]touch wc.input
|
| [root@hadoop01 input]vim wc.input
hadoop mapreduce yarn yarn
|
| [root@hadoop101 hadoop-2.7.2]hadoop fs -put input/ /tmp/
|
运行官方jar包
| [root@hadoop101 hadoop-2.7.2]hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.2.jar wordcount /tmp/input/ /tmp/output/
|
查看wordcount统计词频
| [root@hadoop101 hadoop-2.7.2]hadoop fs -cat /tmp/output//part-r-00000
hadoop 1 mapreduce 1 yarn 2
|