This repository has been archived by the owner on Apr 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
55 lines (40 loc) · 2.75 KB
/
Makefile
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
43
44
45
46
47
48
49
50
51
52
53
54
55
deploy:
scp -r hadoop-docker root@124.70.146.167:~
scp -o 'ProxyJump root@124.70.146.167' -r hadoop-docker root@192.168.0.200:~
scp -o 'ProxyJump root@124.70.146.167' -r hadoop-docker root@192.168.0.249:~
swarm-deploy: deploy
ssh root@124.70.146.167 "cd ~/hadoop-docker && ls -al && make swarm-deploy"
status:
ssh root@124.70.146.167 "docker ps"
ssh -J root@124.70.146.167 root@192.168.0.200 "docker ps"
ssh -J root@124.70.146.167 root@192.168.0.249 "docker ps"
up: deploy
ssh root@124.70.146.167 "cd ~/hadoop-docker && ls -al && make master"
ssh -J root@124.70.146.167 root@192.168.0.200 "cd ~/hadoop-docker && ls && make worker_1"
ssh -J root@124.70.146.167 root@192.168.0.249 "cd ~/hadoop-docker && ls && make worker_2"
down:
ssh root@124.70.146.167 "cd ~/hadoop-docker && ls -al && make down"
ssh -J root@124.70.146.167 root@192.168.0.200 "cd ~/hadoop-docker && ls && make down"
ssh -J root@124.70.146.167 root@192.168.0.249 "cd ~/hadoop-docker && ls && make down"
hadoop-build:
cd map-reduce-temperature && mvn clean install
hadoop-deploy: hadoop-build
scp map-reduce-temperature/target/map-reduce-temperature-1.0-SNAPSHOT.jar root@124.70.146.167:~/hadoop-docker/hadoop_namenode
hadoop-run:
ssh root@124.70.146.167 "cd ~/hadoop-docker && docker-compose exec -T hadoop-namenode hadoop fs -rm -r hdfs://node-master.lan:9000/user/hadoop/hadoop.output || true"
ssh root@124.70.146.167 "cd ~/hadoop-docker && docker-compose exec -T hadoop-namenode hadoop jar /hadoop/dfs/name/map-reduce-temperature-1.0-SNAPSHOT.jar Temperature hdfs://node-master.lan:9000/user/hadoop/input hdfs://node-master.lan:9000/user/hadoop/hadoop.output"
spark-build:
cd spark-temperature && sbt package
spark-deploy: spark-build
scp spark-temperature/target/scala-2.11/spark-temperature_2.11-0.1.jar root@124.70.146.167:~/hadoop-docker/hadoop_namenode
spark-run:
ssh root@124.70.146.167 "cd ~/hadoop-docker && docker-compose exec -T hadoop-namenode hadoop fs -rm -r hdfs://node-master.lan:9000/user/hadoop/spark.output || true"
ssh root@124.70.146.167 "/opt/spark/bin/spark-submit --master spark://node-master.lan:7077 ~/hadoop-docker/hadoop_namenode/spark-temperature_2.11-0.1.jar hdfs://node-master.lan:9000/user/hadoop/input/London2013.csv hdfs://node-master.lan:9000/user/hadoop/spark.output"
spark-run-local: spark-build
spark-submit spark-temperature/target/scala-2.11/spark-temperature_2.11-0.1.jar ~/Work/data/London2013.csv spark.output
cat spark.output/part-00000
rm -rf spark.output
hadoop-cat:
ssh root@124.70.146.167 "cd ~/hadoop-docker && docker-compose exec -T hadoop-namenode hadoop fs -cat /user/hadoop/hadoop.output/part-r-00000"
spark-cat:
ssh root@124.70.146.167 "cd ~/hadoop-docker && docker-compose exec -T hadoop-namenode hadoop fs -cat /user/hadoop/spark.output/part-00000"