Manually configure dynamic resource allocation
Use the following steps to manually configure dynamic resource allocation settings.
-
Add the following properties to the
spark-defaults.conffile associated with your Spark installation (typically in the$SPARK_HOME/confdirectory):-
Set
spark.dynamicAllocation.enabledtotrue. -
Set
spark.shuffle.service.enabledtotrue.
-
-
(Optional) To specify a starting point and range for the number of executors, use the following properties:
-
spark.dynamicAllocation.initialExecutors -
spark.dynamicAllocation.minExecutors -
spark.dynamicAllocation.maxExecutors
Note that
For a description of each property, see "Dynamic Resource Allocation Properties" in this guide.initialExecutorsmust be greater than or equal tominExecutors, and less than or equal tomaxExecutors. -
-
Start the shuffle service on each worker node in the cluster:
- In the
yarn-site.xmlfile on each node, addspark_shuffletoyarn.nodemanager.aux-services, and then setyarn.nodemanager.aux-services.spark_shuffle.classtoorg.apache.spark.network.yarn.YarnShuffleService. - Review and, if necessary, edit
spark.shuffle.service.*configuration settings. - Restart all NodeManagers in your cluster.
- In the

