作业六:Hadoop使用实例
词频统计
1.下载喜欢的电子书或大量文本数据,并保存在本地文本文件中

2.编写map与reduce函数



3.本地测试map与reduce


4.将文本数据上传至HDFS上



5.用hadoop streaming提交任务



hadoop jar $STREAM \ -file /home/hadoop/wc/mapper.py \ -mapper /home/hadoop/wc/mapper.py \ -file /home/hadoop/wc/reducer.py \ -reducer /home/hadoop/wc/reducer.py \ -input /user/hadoop/input/*.txt \ -output /user/hadoop/wcoutput

6.查看运行结果

7.计算结果取回到本地



浙公网安备 33010602011771号