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

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/:

主站蜘蛛池模板: 耒阳市| 临清市| 惠州市| 萝北县| 江北区| 出国| 防城港市| 镇原县| 图木舒克市| 泰宁县| 昌江| 年辖:市辖区| 贺州市| 万载县| 嫩江县| 乡宁县| 南投市| 德庆县| 张家界市| 宜阳县| 镇江市| 西城区| 富平县| 英超| 年辖:市辖区| 淅川县| 历史| 宜昌市| 板桥市| 景德镇市| 兴隆县| 宜章县| 屯留县| 扶沟县| 蒲江县| 兴和县| 玉山县| 平昌县| 红原县| 青河县| 朝阳县|