脚本:
例1:
#!/bin/bash
HADOOP_HOME=/home/alan/hadoop/hadoop-0.20.2-cdh3u6
${HADOOP_HOME}/bin/hadoop jar\
${HADOOP_HOME}/contrib/streaming/hadoop-streaming-0.20.2-cdh3u6.jar\
-files wc_mapper,wc_reducer\
-input /test/input\
-output /test/output\
-mapper wc_mapper\
-reducer wc_reducer
例2:
#!/bin/bash
bin/hadoop jar \
contrib/streaming/hadoop-streaming-0.20.2-cdh3u6.jar \
-D mapred.reduce.tasks=10 \
-file ./mapper.php \
-mapper "php mapper.php" \
-file ./reducer.php \
-reducer "php reducer.php" \
-input /test/input \
-output /test/output