[英]Why is the number of spark executors reduced using custom settings on EMR
我正在EMR 4.3.0上使用以下設置運行spark 1.6,集群模式:
[
{
"classification": "spark-defaults",
"properties": {
"spark.executor.cores" : "16"
}
},
{
"classification": "spark",
"properties": {
"maximizeResourceAllocation": "true"
}
}
]
對於以下情況:
master: 1 * m3.xlarge
core: 2 * m3.xlarge
當我通過以下方式測試執行程序的數量時:
val numExecutors = sc.getExecutorStorageStatus.size - 1
我只得到2 。
火花的EMR設置是否被覆蓋?
好的,這是問題所在:您正在設置每個執行程序的核心數量,而不是執行程序的數量。 例如"spark.executor.cores" : "16"
。
而且,由於您使用的是AWS EMR,因此這也意味着您正在使用YARN
。
默認情況下,執行程序實例的數量為2( spark.executor.instances
是定義執行程序數量的屬性)。
注意 :
spark.dynamicAllocation.enabled
不兼容。 如果同時指定了spark.dynamicAllocation.enabled
和spark.executor.instances
,則動態分配將關閉,並使用指定數量的spark.executor.instances
。 這樣您將獲得以下內容:
scala> val numExecutors = sc.getExecutorStorageStatus.size - 1
res1 : numberExectuors : Int = 2
這意味着您實際上使用的是兩個執行程序,每個從屬程序一個僅在1個內核上運行的執行程序。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.