zhongyaohong

View Post

Hadoop使用实例

1、下载喜欢的电子书或大量文本数据,并保存在本地文本文件中

wget http://www.gutenberg.org/files/1342/1342-0.txt

 

 

 

 

2、编写map与reduce函数

 

 

 gedit mapper.py

 

gedit  reduce.py

 

 

 

 

 

 

3、本地测试map与reduce

 

 gedit my.txt

 

 

 

 

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

 

 

 

 

5、用hadoop streaming提交任务

 

 

 

 

 

 

6、查看运行结果

 

 

7、计算结果取回到本地

 

 

分类:

技术点:

相关文章: