summaryrefslogtreecommitdiff
path: root/hadoop/cacheArchive/streaming.sh
blob: 6bc9cda5c273acfa18370fed5f129f04131ee23f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

HADOOP_HOME=/usr/lib/hadoop
HADOOP_VERSION=0.20.2-cdh3u1
JAR=contrib/streaming/hadoop-streaming-$HADOOP_VERSION.jar
HSTREAMING="$HADOOP_HOME/bin/hadoop jar $HADOOP_HOME/$JAR"

hadoop dfs -put input input
hadoop dfs -put my_module.zip my_module.zip
hadoop dfs -put other_module.zip other_module.zip

IN=input
OUT=output

$HSTREAMING \
    -input  $IN\
    -output $OUT \
    -mapper "python mapper.py" \
    -reducer "NONE" \
    -file mapper.py\
    -cacheArchive 'hdfs:///user/simianer/my_module.zip#my_module' \
    -cacheArchive 'hdfs:///user/simianer/other_module.zip#other_module' \
    -jobconf mapred.reduce.tasks=30 #hier mal 30 statt 3

hadoop dfs -get $OUT .
hadoop dfs -rm $IN
hadoop dfs -rmr $OUT