对Spark所支持的各个集群管理器而言,最简单的的资源分配,就是静态划分.这种方式就意味着,每个Spark应用都是设定一个最大可用资源总量,并且该应用在整个生命周期内都会占住这个资源.这种方式在 Spark’s独立部署 [standalone](spark-standalone.html) 和 [YARN](running-on-yarn.html)调度,以及Mesos粗粒度模式下都可用.[coarse-grained Mesos mode](running-on-mesos.html#mesos-run-modes) . Resource allocation can be configured as follows,based on the cluster type:
对 Spark 所支持的各个集群管理器而言,最简单的的资源分配,就是静态划分。这种方式就意味着,每个 Spark 应用都是设定一个最大可用资源总量,并且该应用在整个生命周期内都会占住这个资源。这种方式在 Spark’s 独立部署 [standalone](spark-standalone.html) 和 [YARN](running-on-yarn.html)调度,以及 Mesos 粗粒度模式下都可用。[coarse-grained Mesos mode](running-on-mesos.html#mesos-run-modes)。Resource allocation can be configured as follows,based on the cluster type:
要使用这一特性有两个前提条件。首先,你的应用必须设置spark.dynamicAllocation.enabled为true。其次,你必须在每个节点上启动external shuffle service,并将spark.shuffle.service.enabled设为true。external shuffle service 的目的是在移除executor的时候,能够保留executor输出的shuffle文件(本文后续有更新的描述 [below](job-scheduling.html#graceful-decommission-of-executors))。启用external shuffle service 的方式在各个集群管理器上各不相同: