终端命令以不同模式运行Python Spark
在“终端”中以不同模式运行Python Spark程序需要输入很长的命令,例如分别以local、Hadoop YARN、和Spark Standalone模式运行Python Spark(这里以~/pythonwork/PythonProject/wordcount.py为例)每次都要输入命令:
local:
cd ~/pythonwork/PythonProject
spark-submit --driver-memory 2g --master local[4] wordcount.py
Hadoop YARN:
cd ~/pythonwork/PythonProject
Hadoop_CONF_DIR=/usr/local/hadoop/etc/hadoop spark-submit --driver-memory 512m --executor-cores 2 --master yarn --deploy-mode client wordcount.py
Spark Standalone:
cd ~/pythonwork/PythonProject
spark-submit --master spark://master:7077 --deploy-mode client --executor-memory 500M --deploy-mode client --total-executor-cores 2 wordcount.py