1 建立项目
下载见附件:
https://download.csdn.net/upload/success
导出jar:
HdfsDemo-1.0-SNAPSHOT.jar
2 建立测试1.txt
hello
hello
world
hahah
how
上传到hadoop上:
hdfs dfs -mkdir -p /user/centos/wc/data
hdfs dfs -put 1.txt wc/data
3 测试脚本
hadoop jar HdfsDemo-1.0-SNAPSHOT.jar com.it18zhang.hdfs.mr.WCApp hdfs://s200/user/centos/wc/data hdfs://s200/user/centos/wc/data/out
4 查看进度
http://192.168.77.200:8088/cluster/apps/RUNNING
5 查看深成统计文本
hdfs dfs -cat /user/centos/wc/data/out/part-r-00000