You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 2
Next »
Hadoop - my first MapReduce (M/R) code
- install VMware on the local machine
- import Hadoop server from http://www.cloudera.com/hadoop-training-virtual-machine

- fire VM up
- To use Streamers add system variable:
export SJAR=/usr/lib/hadoop/contrib/streaming/hadoop-0.20.1+133-streaming.jar
Now you can writhe M?R in any language
- upload Shakespeare text to HDFS (Hadoop Distributed File System)
cd ~/git/data
tar vzxf shakespeare.tar.gz
check nothig is in HDFS
hadoop fs -ls /user/training
add unpacked text gile to HDFS and check again
hadoop fs -put input /user/training/inputShak
- (source) (target)
hadoop fs -ls /user/training
- Execute M/R job using 'cat' & 'wc'
hadoop jar $SJAR \
-mapper cat \
-reducer wc \
-input inputShak \
-output outputShak
- inspect output in
hadoop fs -cat outputShak/p*