-
Notifications
You must be signed in to change notification settings - Fork 0
/
startSpark.sh
executable file
·48 lines (38 loc) · 1.11 KB
/
startSpark.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
43
44
45
46
47
48
#! /bin/sh
export JAVA_OPTS="-Xmx2000m"
version="1.0"
scalaVersion="2.11"
filePath="$PWD"
fileName="Spark"
Class="SparkCore"
jarPath=$filePath/target/scala-$scalaVersion/$fileName-assembly-$version.jar
master=192.168.4.70
mesos_master=192.168.4.70
mesos_dispatcher=192.168.4.72
mesos_dispatcher_port=5927
if [ -z "$1" ]
then
echo "Parameter error, please set local/master/mesos/mesos/cluster"
echo "will start at local"
spark-submit --class $Class --master local[4] $jarPath
fi
if [ "$1" = "local" ]
then
echo "start at local"
spark-submit --class $Class --master local[4] $jarPath
fi
if [ "$1" = "master" ]
then
echo "start at spark://master:7077"
spark-submit --class $Class --master spark://service:7077 $jarPath
fi
if [ "$1" = "mesos" ]
then
echo "start at mesos://master:5050"
spark-submit --class $Class --master mesos://$mesos_master:5050 $jarPath
fi
if [ "$1" = "mesos_cluster" ]
then
echo "start at mesos://$mesos_dispatcher:$mesos_dispatcher_port"
spark-submit --class $Class --master mesos://$mesos_dispatcher:$mesos_dispatcher_port --deploy-mode cluster $jarPath
fi