Spark2.3(三十六):根据appName验证某个app是否在运行

具体脚本

#/bin/sh
#LANG=zh_CN.utf8
#export LANG
export SPARK_KAFKA_VERSION=0.10
export LANG=zh_CN.UTF-8

# export env variable
if [ -f ~/.bash_profile ];
then
source ~/.bash_profile
fi
source /etc/profile


myAppName='SPARK APP NAME'
apps=''

for app in `yarn application -list`
do
  apps=${app},$apps
done

apps=${apps%?}


if [[ $apps =~ $myAppName ]]
then
  echo "included"
else
  echo "not included,do submit...."
    ./submit_x1_x2.sh abc TestRestartDriver
fi

 

posted @ 2018-12-12 10:46  cctext  阅读(752)  评论(0编辑  收藏  举报