Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
spark
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cs525-sp18-g07
spark
Commits
67af8031
Commit
67af8031
authored
11 years ago
by
Raymond Liu
Browse files
Options
Downloads
Patches
Plain Diff
Export --file for YarnClient mode to support sending extra files to worker on yarn cluster
parent
da4694a0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/running-on-yarn.md
+2
-0
2 additions, 0 deletions
docs/running-on-yarn.md
yarn/common/src/main/scala/org/apache/spark/scheduler/cluster/YarnClientSchedulerBackend.scala
+3
-1
3 additions, 1 deletion
.../spark/scheduler/cluster/YarnClientSchedulerBackend.scala
with
5 additions
and
1 deletion
docs/running-on-yarn.md
+
2
−
0
View file @
67af8031
...
@@ -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.
...
...
This diff is collapsed.
Click to expand it.
yarn/common/src/main/scala/org/apache/spark/scheduler/cluster/YarnClientSchedulerBackend.scala
+
3
−
1
View file @
67af8031
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment