diff options
author | WangTaoTheTonic <barneystinson@aliyun.com> | 2014-10-01 15:15:09 -0700 |
---|---|---|
committer | Michael Armbrust <michael@databricks.com> | 2014-10-01 15:15:24 -0700 |
commit | d61f2c15bb22253bfdda77462b1bd383987d2f5a (patch) | |
tree | a1e90441252ab3d670e76b5139d020837d18f33a /sbin/spark-daemon.sh | |
parent | fcad3fae6135bc2c9bdaf9e4c3cfe24838e63eae (diff) | |
download | spark-d61f2c15bb22253bfdda77462b1bd383987d2f5a.tar.gz spark-d61f2c15bb22253bfdda77462b1bd383987d2f5a.tar.bz2 spark-d61f2c15bb22253bfdda77462b1bd383987d2f5a.zip |
[SPARK-3658][SQL] Start thrift server as a daemon
https://issues.apache.org/jira/browse/SPARK-3658
And keep the `CLASS_NOT_FOUND_EXIT_STATUS` and exit message in `SparkSubmit.scala`.
Author: WangTaoTheTonic <barneystinson@aliyun.com>
Author: WangTao <barneystinson@aliyun.com>
Closes #2509 from WangTaoTheTonic/thriftserver and squashes the following commits:
5dcaab2 [WangTaoTheTonic] issue about coupling
8ad9f95 [WangTaoTheTonic] generalization
598e21e [WangTao] take thrift server as a daemon
Diffstat (limited to 'sbin/spark-daemon.sh')
-rwxr-xr-x | sbin/spark-daemon.sh | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sbin/spark-daemon.sh b/sbin/spark-daemon.sh index bd476b400e..cba475e2dd 100755 --- a/sbin/spark-daemon.sh +++ b/sbin/spark-daemon.sh @@ -62,7 +62,7 @@ then shift fi -startStop=$1 +option=$1 shift command=$1 shift @@ -122,9 +122,9 @@ if [ "$SPARK_NICENESS" = "" ]; then fi -case $startStop in +case $option in - (start) + (start|spark-submit) mkdir -p "$SPARK_PID_DIR" @@ -142,8 +142,14 @@ case $startStop in spark_rotate_log "$log" echo starting $command, logging to $log - cd "$SPARK_PREFIX" - nohup nice -n $SPARK_NICENESS "$SPARK_PREFIX"/bin/spark-class $command "$@" >> "$log" 2>&1 < /dev/null & + if [ $option == spark-submit ]; then + source "$SPARK_HOME"/bin/utils.sh + gatherSparkSubmitOpts "$@" + nohup nice -n $SPARK_NICENESS "$SPARK_PREFIX"/bin/spark-submit --class $command \ + "${SUBMISSION_OPTS[@]}" spark-internal "${APPLICATION_OPTS[@]}" >> "$log" 2>&1 < /dev/null & + else + nohup nice -n $SPARK_NICENESS "$SPARK_PREFIX"/bin/spark-class $command "$@" >> "$log" 2>&1 < /dev/null & + fi newpid=$! echo $newpid > $pid sleep 2 |