-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.sh
executable file
·42 lines (36 loc) · 1.36 KB
/
run.sh
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
echo javac -cp /usr/lib/hadoop/*:/usr/lib/hadoop/client-0.20/* *.java
read -p "[Enter to run]"
javac -cp /usr/lib/hadoop/*:/usr/lib/hadoop/client-0.20/* *.java
read -p "[Enter to Continue]"
echo
echo jar -cvf hadoop_job.jar *.class
read -p "[Enter to run]"
jar -cvf hadoop_job.jar *.class
read -p "[Enter to Continue]"
echo
echo hdfs dfs -rm -f -r /user/cloudera/wordcount
read -p "[Enter to run]"
hdfs dfs -rm -f -r /user/cloudera/wordcount
read -p "[Enter to Continue]"
echo
echo hdfs dfs -mkdir /user/cloudera/wordcount/input
read -p "[Enter to run]"
hdfs dfs -mkdir /user/cloudera/wordcount/input
read -p "[Enter to Continue]"
echo
echo hdfs dfs -put input/* /user/cloudera/wordcount/input/
read -p "[Enter to run]"
hdfs dfs -put input/* /user/cloudera/wordcount/input/
read -p "[Enter to Continue]"
echo
echo hadoop jar hadoop_job.jar OrderedCount /user/cloudera/wordcount/input /user/cloudera/wordcount/output /user/cloudera/wordcount/output2
read -p "[Enter to run]"
hadoop jar hadoop_job.jar OrderedCount /user/cloudera/wordcount/input /user/cloudera/wordcount/output /user/cloudera/wordcount/output2
read -p "[Enter to Continue]"
echo
rm -f results.txt
echo hdfs dfs -get /user/cloudera/wordcount/output2/part-00000 ./results.txt
read -p "[Enter to run]"
hdfs dfs -get /user/cloudera/wordcount/output2/part-00000 ./results.txt
echo "Done! Results file is results.txt"