File tree Expand file tree Collapse file tree 3 files changed +8
-16
lines changed
core/src/main/scala/org/apache/spark Expand file tree Collapse file tree 3 files changed +8
-16
lines changed Original file line number Diff line number Diff line change @@ -175,6 +175,10 @@ class SparkContext(config: SparkConf) extends SparkStatusAPI with Logging {
175
175
logInfo(" Spark configuration:\n " + conf.toDebugString)
176
176
}
177
177
178
+ // Set Spark driver host and port system properties.
179
+ conf.setIfMissing(" spark.driver.host" , Utils .localHostName())
180
+ conf.setIfMissing(" spark.driver.port" , " 0" )
181
+
178
182
val jars : Seq [String ] =
179
183
conf.getOption(" spark.jars" ).map(_.split(" ," )).map(_.filter(_.size != 0 )).toSeq.flatten
180
184
@@ -202,14 +206,6 @@ class SparkContext(config: SparkConf) extends SparkStatusAPI with Logging {
202
206
203
207
if (master == " yarn-client" ) System .setProperty(" SPARK_YARN_MODE" , " true" )
204
208
205
- // Set Spark driver host and port system properties. Ignore host setting in all cluster modes.
206
- if (master.contains(" cluster" )) {
207
- conf.set(" spark.driver.host" , Utils .localHostName())
208
- } else {
209
- conf.setIfMissing(" spark.driver.host" , Utils .localHostName())
210
- }
211
- conf.setIfMissing(" spark.driver.port" , " 0" )
212
-
213
209
// An asynchronous listener bus for Spark events
214
210
private [spark] val listenerBus = new LiveListenerBus
215
211
Original file line number Diff line number Diff line change @@ -155,14 +155,6 @@ object Client {
155
155
}
156
156
conf.set(" spark.akka.askTimeout" , " 10" )
157
157
conf.set(" akka.loglevel" , driverArgs.logLevel.toString.replace(" WARN" , " WARNING" ))
158
-
159
- // Set the web ui port to be ephemeral so we don't conflict with other spark processes
160
- // running on the same box
161
- conf.set(" spark.ui.port" , " 0" )
162
-
163
- // Set the master property to match the requested mode.
164
- conf.set(" spark.master" , " standalone-cluster" )
165
-
166
158
Logger .getRootLogger.setLevel(driverArgs.logLevel)
167
159
168
160
val (actorSystem, _) = AkkaUtils .createActorSystem(
Original file line number Diff line number Diff line change @@ -279,6 +279,10 @@ object SparkSubmit {
279
279
sysProps.getOrElseUpdate(k, v)
280
280
}
281
281
282
+ if (deployMode == CLUSTER ) {
283
+ sysProps -= (" spark.driver.host" )
284
+ }
285
+
282
286
// Resolve paths in certain spark properties
283
287
val pathConfigs = Seq (
284
288
" spark.jars" ,
You can’t perform that action at this time.
0 commit comments