Skip to content
Snippets Groups Projects
Commit 67af8031 authored by Raymond Liu's avatar Raymond Liu
Browse files

Export --file for YarnClient mode to support sending extra files to worker on yarn cluster

parent da4694a0
No related branches found
No related tags found
No related merge requests found
...@@ -114,6 +114,8 @@ For example: ...@@ -114,6 +114,8 @@ For example:
SPARK_YARN_APP_JAR=examples/target/scala-{{site.SCALA_VERSION}}/spark-examples-assembly-{{site.SPARK_VERSION}}.jar \ SPARK_YARN_APP_JAR=examples/target/scala-{{site.SCALA_VERSION}}/spark-examples-assembly-{{site.SPARK_VERSION}}.jar \
MASTER=yarn-client ./bin/spark-shell MASTER=yarn-client ./bin/spark-shell
You can also send extra files to yarn cluster for worker to use by exporting SPARK_YARN_DIST_FILES=file1,file2... etc.
# Building Spark for Hadoop/YARN 2.2.x # Building Spark for Hadoop/YARN 2.2.x
See [Building Spark with Maven](building-with-maven.html) for instructions on how to build Spark using the Maven process. See [Building Spark with Maven](building-with-maven.html) for instructions on how to build Spark using the Maven process.
......
...@@ -39,6 +39,7 @@ private[spark] class YarnClientSchedulerBackend( ...@@ -39,6 +39,7 @@ private[spark] class YarnClientSchedulerBackend(
val defaultWorkerNumber = "1" val defaultWorkerNumber = "1"
val userJar = System.getenv("SPARK_YARN_APP_JAR") val userJar = System.getenv("SPARK_YARN_APP_JAR")
val distFiles = System.getenv("SPARK_YARN_DIST_FILES")
var workerCores = System.getenv("SPARK_WORKER_CORES") var workerCores = System.getenv("SPARK_WORKER_CORES")
var workerMemory = System.getenv("SPARK_WORKER_MEMORY") var workerMemory = System.getenv("SPARK_WORKER_MEMORY")
var workerNumber = System.getenv("SPARK_WORKER_INSTANCES") var workerNumber = System.getenv("SPARK_WORKER_INSTANCES")
...@@ -64,7 +65,8 @@ private[spark] class YarnClientSchedulerBackend( ...@@ -64,7 +65,8 @@ private[spark] class YarnClientSchedulerBackend(
"--worker-memory", workerMemory, "--worker-memory", workerMemory,
"--worker-cores", workerCores, "--worker-cores", workerCores,
"--num-workers", workerNumber, "--num-workers", workerNumber,
"--master-class", "org.apache.spark.deploy.yarn.WorkerLauncher" "--master-class", "org.apache.spark.deploy.yarn.WorkerLauncher",
"--files", distFiles
) )
val args = new ClientArguments(argsArray, conf) val args = new ClientArguments(argsArray, conf)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment