spark submit 运行的时候增加ack命令

4 篇文章 0 订阅

shell运行的时候增加ack命令

在提交spark任务的时候担心写错索引名(spark重建索引),所以增加了一个暂停机制,让执行者再check一下,可以使用下面的样例来进行

cat submit.sh
set -e
export JAVA_HOME=/test/jdk1.8.0_181 # // 设置jdk版本
export SPARK_HOME=/test/spark-2.0.1-bin-2.6.0-cdh5.15.0/  # //设置使用spark2
echo "-------------------------------------------------------------------------------------------------"
echo "try to rebuild the talent index"
echo "index can be: test_user_v2_r0 , test_user_v2_r1"
echo "-------------------------------------------------------------------------------------------------"

WRITE_INDEX=$1
echo "indexer to rebuild : $WRITE_INDEX"

if [ -z $WRITE_INDEX ]
  then
    echo "you need set the index"
    exit 1
  fi

read -r -p "Are You Sure? [Y/n] " input
    case $input in
        [yY][eE][sS]|[yY])
            echo "Yes, will continue"
            ;;
        [nN][oO]|[nN])
            echo "No, will exit"
            exit 1
            ;;
esac

echo " try submit task"

nohup spark-submit --deploy-mode client --master yarn --class com.test.search.test.task.RebuildStarter \
--driver-memory 2G    \
--num-executors 80     \
--queue algo            \
--conf spark.default.parallelism=80 \
--executor-cores 4        \
--executor-memory 16G       \
--conf "spark.yarn.appMasterEnv.JAVA_HOME=/test/jdk1.8.0_181"      \
--conf "spark.executorEnv.JAVA_HOME=/test/jdk1.8.0_181"             \
--conf "spark.yarn.executor.memoryOverhead=2048"                    \
--conf application.submit.user=test@test.com             \
test-profile-dev-1.0-SNAPSHOT.jar \
$WRITE_INDEX    > dev.temp.log 2>&1   &

主要的精华在这里,可以直接测试

read -r -p "Are You Sure? [Y/n] " input
    case $input in
        [yY][eE][sS]|[yY])
            echo "Yes, will continue"
            ;;
        [nN][oO]|[nN])
            echo "No, will exit"
            exit 1
            ;;
esac


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值