对于/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.