1.shell 脚本

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