summaryrefslogtreecommitdiff
path: root/MPE/spark/sbin/set_spark_env.sh
diff options
context:
space:
mode:
Diffstat (limited to 'MPE/spark/sbin/set_spark_env.sh')
-rw-r--r--MPE/spark/sbin/set_spark_env.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/MPE/spark/sbin/set_spark_env.sh b/MPE/spark/sbin/set_spark_env.sh
new file mode 100644
index 0000000..3a351b2
--- /dev/null
+++ b/MPE/spark/sbin/set_spark_env.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+echo -e "\n#spark\nexport SPARK_HOME=/data/tsg/olap/spark-2.2.3-bin-hadoop2.7\nexport PATH=\$SPARK_HOME/sbin:\$PATH\nexport PATH=\$SPARK_HOME/bin:\$PATH" >> /etc/profile.d/spark.sh
+chmod +x /etc/profile.d/spark.sh
+source /etc/profile
+
+keeppath='/etc/init.d/keepsparkall'
+if [ -x $keeppath ];then
+ chkconfig --add keepsparkall
+ chkconfig keepsparkall on
+ service keepsparkall start && sleep 5
+ all_dae=`ps -ef | grep dae-sparkall.sh | grep -v grep | wc -l`
+ if [ $all_dae -eq "0" ];then
+ nohup /data/tsg/olap/spark-2.2.3-bin-hadoop2.7/sbin/dae-sparkall.sh > /dev/null 2>&1 &
+ fi
+fi
+
+keeppath='/etc/init.d/keepsparkmaster'
+if [ -x $keeppath ];then
+ chkconfig --add keepsparkmaster
+ chkconfig keepsparkmaster on
+ service keepsparkmaster start && sleep 5
+ master_dae=`ps -ef | grep dae-sparkmaster.sh | grep -v grep | wc -l`
+ if [ $master_dae -eq "0" ];then
+ nohup /data/tsg/olap/spark-2.2.3-bin-hadoop2.7/sbin/dae-sparkmaster.sh > /dev/null 2>&1 &
+ fi
+fi
+
+keeppath='/etc/init.d/keepsparkworker'
+if [ -x $keeppath ];then
+ chkconfig --add keepsparkworker
+ chkconfig keepsparkworker on
+ service keepsparkworker start && sleep 5
+ worker_dae=`ps -ef | grep dae-sparkworker.sh | grep -v grep | wc -l`
+ if [ $worker_dae -eq "0" ];then
+ nohup /data/tsg/olap/spark-2.2.3-bin-hadoop2.7/sbin/dae-sparkworker.sh > /dev/null 2>&1 &
+ fi
+fi
+