對於/user/root/.sparkStaging下文件,是spark任務依賴文件,可以將jar包上傳到指定目錄下,避免或減少了jar包的重復上傳,進而減少任務的等待時間。
可以在spark的配置文件spark-defaults.conf配置如下內容:
spark.yarn.archive=hdfs://hdfscluster/user/hadoop/jars
spark.yarn.preserve.staging.files=false
spark.yarn.preserve.staging.files的參數說明:
Set to true to preserve the staged files (Spark jar, app jar, distributed cache files) at the end of the job rather than delete them.