1.shell 脚本
#!/bin/bash
if [ ! -n "$JAVA_HOME" ]; then
export JAVA_HOME=/usr/local/jdk1.8.0
export PATH=$PATH:$JAVA_HOME/bin
fi
JAR_PATH=$(cd `dirname $0`; pwd)
cd ${JAR_PATH}/target
spark2-submit \
--master yarn \
--deploy-mode cluster \
--driver-memory 2g \
--num-executors 20 \
--executor-memory 20g \
--executor-cores 8 \
--class com.wsy.WordCount \
wordcount-1.0-SNAPSHOT-jar-with-dependencies.jar