Authored by BuddyJack

Fix

@@ -47,4 +47,27 @@ spark_cmd="nohup ${spark_home} --name ${app_name} ${app_args} --class ${app_mai @@ -47,4 +47,27 @@ spark_cmd="nohup ${spark_home} --name ${app_name} ${app_args} --class ${app_mai
47 mkdir -p /home/hadoop/logs 47 mkdir -p /home/hadoop/logs
48 48
49 hdfs dfs -rm -r "/spark/checkpoint/${app_name}" 49 hdfs dfs -rm -r "/spark/checkpoint/${app_name}"
50 -eval "${spark_cmd}"  
  50 +eval "${spark_cmd}"
  51 +
  52 +
  53 +RES=1
  54 +for i in {1..3}
  55 +do
  56 + sleep 20
  57 + i21=`yarn application -list|grep -w "${app_name}"|awk '{print $6}'`
  58 + if [ "_$i21" == "_RUNNING" ];then
  59 + process=$(ps -ef |grep "${app_name}" |grep '/bin/java' |grep -v grep)
  60 + if [ '_${process}' != '_' ];then
  61 + echo "${process}"
  62 + #kill -9 ${process}
  63 + fi
  64 + RES=1
  65 + break
  66 + fi
  67 + RES=0
  68 +done
  69 +
  70 +if [ ${RES} -ne 1 ];then
  71 + exit 1
  72 +fi
  73 +exit 0