官术网_书友最值得收藏!

Different modes of execution

The Spark application can run in different modes, which are categorized by where and how we want to configure the master and what the executor's resource requirements are.

The master can run on the same local machine, along with executors; it can also run over a specific machine with the provided host and port. If we configure YARN as a Spark resource manager, the master can be managed by YARN:

# Run application locally on 8 cores
./bin/spark-submit \
--class org.apache.spark.examples.SparkPi \
--master local[8] \
/path/to/examples.jar \
100

# Run on a Spark standalone cluster in client deploy mode
./bin/spark-submit \
--class org.apache.spark.examples.SparkPi \
--master spark://host-ip:7077 \
--executor-memory 20G \
--total-executor-cores 100 \
/path/to/examples.jar \
1000

# Run on a YARN cluster
export HADOOP_CONF_DIR=XXX
./bin/spark-submit \
--class org.apache.spark.examples.SparkPi \
--master yarn \
--deploy-mode cluster \ # can be client for client mode
--executor-memory 20G \
--num-executors 50 \
/path/to/examples.jar \
1000

Source: https://spark.apache.org/docs/latest/submitting-applications.html.

Spark UI: Spark provides a web interface for application execution, which is accessible by default at port 4040: http://localhost:4040/jobs/:

主站蜘蛛池模板: 崇信县| 井冈山市| 隆化县| 靖江市| 托里县| 阳新县| 分宜县| 保德县| 浮梁县| 乌兰县| 玛纳斯县| 东海县| 兴宁市| 康保县| 南雄市| 勐海县| 剑川县| 策勒县| 朝阳市| 富阳市| 扎兰屯市| 长岛县| 金湖县| 松桃| 静乐县| 萨嘎县| 筠连县| 英山县| 铅山县| 淮安市| 工布江达县| 紫金县| 明溪县| 海原县| 株洲县| 延边| 佛冈县| 遵化市| 涪陵区| 五常市| 横峰县|