大数据任务脚本

#!/bin/sh

set -o errexit

bindir=$(cd $(dirname 0 ) ; p w d ) e c h o " h o m e = 0); pwd) echo "home= 0);pwd)echo"home=bindir"

day=date -d -1hour +%Y-%m-%d
hour=date -d -1hour +%H

if [ $# -eq 2 ];then
echo “hello~~~~~”
day=$1
hour=$2
fi

echo "day:" d a y e c h o " h o u r : " day echo "hour:" dayecho"hour:"hour

echo “====rm local jar”
rm -rf $bindir/*.jar

res=$?
if [ $res -ne 0 ];then
exit $?
fi

#rm -rf spark-etl.jar
echo “===down jars file: /footstone/hbase/wifi/jars”
hadoop fs -get /footstone/hbase/wifi/jars/test-project-1.0-SNAPSHOT.jar
res=$?
if [ $res -ne 0 ];then
exit $res
fi

/opt/cloudera/parcels/CDH-6.0.1-1.cdh6.0.1.p0.590678/bin/spark-submit
–class bigdata.Work
–master yarn \
–deploy-mode client
–conf “spark.yarn.executor.memoryOverhead=500”
–conf “spark.ui.enabled=false”
–conf “spark.executor.heartbeatInterval=30s”
–conf “spark.default.parallelism=10” \
–conf “spark.storage.memoryFraction=0.4”
–executor-memory 3g --executor-cores 1 --num-executors 60
–driver-memory 2g
–driver-class-path “$bindir/bigdata.properties” \
$bindir/test-project-1.0-SNAPSHOT.jar $day $hour

res=$?
if [ $res -ne 0 ];then
exit $res
fi

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值