Commit 50248dc 1 parent 3fd3ee0 commit 50248dc Copy full SHA for 50248dc
File tree 5 files changed +16
-10
lines changed
core/src/main/scala/org/apache/spark/deploy/master
5 files changed +16
-10
lines changed Original file line number Diff line number Diff line change 42
42
# - SPARK_DRIVER_MEMORY, Memory for Driver (e.g. 1000M, 2G) (Default: 1G)
43
43
44
44
# Options for the daemons used in the standalone deploy mode
45
- # - SPARK_MASTER_IP , to bind the master to a different IP address or hostname
45
+ # - SPARK_MASTER_HOST , to bind the master to a different IP address or hostname
46
46
# - SPARK_MASTER_PORT / SPARK_MASTER_WEBUI_PORT, to use non-default ports for the master
47
47
# - SPARK_MASTER_OPTS, to set config properties only for the master (e.g. "-Dx=y")
48
48
# - SPARK_WORKER_CORES, to set the number of cores to use on this machine
Original file line number Diff line number Diff line change @@ -20,18 +20,24 @@ package org.apache.spark.deploy.master
20
20
import scala .annotation .tailrec
21
21
22
22
import org .apache .spark .SparkConf
23
+ import org .apache .spark .internal .Logging
23
24
import org .apache .spark .util .{IntParam , Utils }
24
25
25
26
/**
26
27
* Command-line parser for the master.
27
28
*/
28
- private [master] class MasterArguments (args : Array [String ], conf : SparkConf ) {
29
+ private [master] class MasterArguments (args : Array [String ], conf : SparkConf ) extends Logging {
29
30
var host = Utils .localHostName()
30
31
var port = 7077
31
32
var webUiPort = 8080
32
33
var propertiesFile : String = null
33
34
34
35
// Check for settings in environment variables
36
+ if (System .getenv(" SPARK_MASTER_IP" ) != null ) {
37
+ logWarning(" SPARK_MASTER_IP is deprecated, please use SPARK_MASTER_HOST" )
38
+ host = System .getenv(" SPARK_MASTER_IP" )
39
+ }
40
+
35
41
if (System .getenv(" SPARK_MASTER_HOST" ) != null ) {
36
42
host = System .getenv(" SPARK_MASTER_HOST" )
37
43
}
Original file line number Diff line number Diff line change @@ -94,8 +94,8 @@ You can optionally configure the cluster further by setting environment variable
94
94
<table class =" table " >
95
95
<tr ><th style =" width :21% " >Environment Variable</th ><th >Meaning</th ></tr >
96
96
<tr >
97
- <td><code>SPARK_MASTER_IP </code></td>
98
- <td>Bind the master to a specific IP address, for example a public one.</td>
97
+ <td><code>SPARK_MASTER_HOST </code></td>
98
+ <td>Bind the master to a specific hostname or IP address, for example a public one.</td>
99
99
</tr >
100
100
<tr >
101
101
<td><code>SPARK_MASTER_PORT</code></td>
Original file line number Diff line number Diff line change @@ -47,14 +47,14 @@ if [ "$SPARK_MASTER_PORT" = "" ]; then
47
47
SPARK_MASTER_PORT=7077
48
48
fi
49
49
50
- if [ " $SPARK_MASTER_IP " = " " ]; then
51
- SPARK_MASTER_IP =` hostname`
50
+ if [ " $SPARK_MASTER_HOST " = " " ]; then
51
+ SPARK_MASTER_HOST =` hostname`
52
52
fi
53
53
54
54
if [ " $SPARK_MASTER_WEBUI_PORT " = " " ]; then
55
55
SPARK_MASTER_WEBUI_PORT=8080
56
56
fi
57
57
58
58
" ${SPARK_HOME} /sbin" /spark-daemon.sh start $CLASS 1 \
59
- --ip $SPARK_MASTER_IP --port $SPARK_MASTER_PORT --webui-port $SPARK_MASTER_WEBUI_PORT \
59
+ --host $SPARK_MASTER_HOST --port $SPARK_MASTER_PORT --webui-port $SPARK_MASTER_WEBUI_PORT \
60
60
$ORIGINAL_ARGS
Original file line number Diff line number Diff line change @@ -31,9 +31,9 @@ if [ "$SPARK_MASTER_PORT" = "" ]; then
31
31
SPARK_MASTER_PORT=7077
32
32
fi
33
33
34
- if [ " $SPARK_MASTER_IP " = " " ]; then
35
- SPARK_MASTER_IP =" ` hostname` "
34
+ if [ " $SPARK_MASTER_HOST " = " " ]; then
35
+ SPARK_MASTER_HOST =" ` hostname` "
36
36
fi
37
37
38
38
# Launch the slaves
39
- " ${SPARK_HOME} /sbin/slaves.sh" cd " ${SPARK_HOME} " \; " ${SPARK_HOME} /sbin/start-slave.sh" " spark://$SPARK_MASTER_IP :$SPARK_MASTER_PORT "
39
+ " ${SPARK_HOME} /sbin/slaves.sh" cd " ${SPARK_HOME} " \; " ${SPARK_HOME} /sbin/start-slave.sh" " spark://$SPARK_MASTER_HOST :$SPARK_MASTER_PORT "
You can’t perform that action at this time.
0 commit comments