Skip to content
Snippets Groups Projects
Commit 50248dcf authored by bomeng's avatar bomeng Committed by Sean Owen
Browse files

[SPARK-15806][DOCUMENTATION] update doc for SPARK_MASTER_IP

## What changes were proposed in this pull request?

SPARK_MASTER_IP is a deprecated environment variable. It is replaced by SPARK_MASTER_HOST according to MasterArguments.scala.

## How was this patch tested?

Manually verified.

Author: bomeng <bmeng@us.ibm.com>

Closes #13543 from bomeng/SPARK-15806.
parent 3fd3ee03
No related branches found
No related tags found
No related merge requests found
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
# - SPARK_DRIVER_MEMORY, Memory for Driver (e.g. 1000M, 2G) (Default: 1G) # - SPARK_DRIVER_MEMORY, Memory for Driver (e.g. 1000M, 2G) (Default: 1G)
# Options for the daemons used in the standalone deploy mode # Options for the daemons used in the standalone deploy mode
# - SPARK_MASTER_IP, to bind the master to a different IP address or hostname # - SPARK_MASTER_HOST, to bind the master to a different IP address or hostname
# - SPARK_MASTER_PORT / SPARK_MASTER_WEBUI_PORT, to use non-default ports for the master # - SPARK_MASTER_PORT / SPARK_MASTER_WEBUI_PORT, to use non-default ports for the master
# - SPARK_MASTER_OPTS, to set config properties only for the master (e.g. "-Dx=y") # - SPARK_MASTER_OPTS, to set config properties only for the master (e.g. "-Dx=y")
# - SPARK_WORKER_CORES, to set the number of cores to use on this machine # - SPARK_WORKER_CORES, to set the number of cores to use on this machine
......
...@@ -20,18 +20,24 @@ package org.apache.spark.deploy.master ...@@ -20,18 +20,24 @@ package org.apache.spark.deploy.master
import scala.annotation.tailrec import scala.annotation.tailrec
import org.apache.spark.SparkConf import org.apache.spark.SparkConf
import org.apache.spark.internal.Logging
import org.apache.spark.util.{IntParam, Utils} import org.apache.spark.util.{IntParam, Utils}
/** /**
* Command-line parser for the master. * Command-line parser for the master.
*/ */
private[master] class MasterArguments(args: Array[String], conf: SparkConf) { private[master] class MasterArguments(args: Array[String], conf: SparkConf) extends Logging {
var host = Utils.localHostName() var host = Utils.localHostName()
var port = 7077 var port = 7077
var webUiPort = 8080 var webUiPort = 8080
var propertiesFile: String = null var propertiesFile: String = null
// Check for settings in environment variables // Check for settings in environment variables
if (System.getenv("SPARK_MASTER_IP") != null) {
logWarning("SPARK_MASTER_IP is deprecated, please use SPARK_MASTER_HOST")
host = System.getenv("SPARK_MASTER_IP")
}
if (System.getenv("SPARK_MASTER_HOST") != null) { if (System.getenv("SPARK_MASTER_HOST") != null) {
host = System.getenv("SPARK_MASTER_HOST") host = System.getenv("SPARK_MASTER_HOST")
} }
......
...@@ -94,8 +94,8 @@ You can optionally configure the cluster further by setting environment variable ...@@ -94,8 +94,8 @@ You can optionally configure the cluster further by setting environment variable
<table class="table"> <table class="table">
<tr><th style="width:21%">Environment Variable</th><th>Meaning</th></tr> <tr><th style="width:21%">Environment Variable</th><th>Meaning</th></tr>
<tr> <tr>
<td><code>SPARK_MASTER_IP</code></td> <td><code>SPARK_MASTER_HOST</code></td>
<td>Bind the master to a specific IP address, for example a public one.</td> <td>Bind the master to a specific hostname or IP address, for example a public one.</td>
</tr> </tr>
<tr> <tr>
<td><code>SPARK_MASTER_PORT</code></td> <td><code>SPARK_MASTER_PORT</code></td>
......
...@@ -47,8 +47,8 @@ if [ "$SPARK_MASTER_PORT" = "" ]; then ...@@ -47,8 +47,8 @@ if [ "$SPARK_MASTER_PORT" = "" ]; then
SPARK_MASTER_PORT=7077 SPARK_MASTER_PORT=7077
fi fi
if [ "$SPARK_MASTER_IP" = "" ]; then if [ "$SPARK_MASTER_HOST" = "" ]; then
SPARK_MASTER_IP=`hostname` SPARK_MASTER_HOST=`hostname`
fi fi
if [ "$SPARK_MASTER_WEBUI_PORT" = "" ]; then if [ "$SPARK_MASTER_WEBUI_PORT" = "" ]; then
...@@ -56,5 +56,5 @@ if [ "$SPARK_MASTER_WEBUI_PORT" = "" ]; then ...@@ -56,5 +56,5 @@ if [ "$SPARK_MASTER_WEBUI_PORT" = "" ]; then
fi fi
"${SPARK_HOME}/sbin"/spark-daemon.sh start $CLASS 1 \ "${SPARK_HOME}/sbin"/spark-daemon.sh start $CLASS 1 \
--ip $SPARK_MASTER_IP --port $SPARK_MASTER_PORT --webui-port $SPARK_MASTER_WEBUI_PORT \ --host $SPARK_MASTER_HOST --port $SPARK_MASTER_PORT --webui-port $SPARK_MASTER_WEBUI_PORT \
$ORIGINAL_ARGS $ORIGINAL_ARGS
...@@ -31,9 +31,9 @@ if [ "$SPARK_MASTER_PORT" = "" ]; then ...@@ -31,9 +31,9 @@ if [ "$SPARK_MASTER_PORT" = "" ]; then
SPARK_MASTER_PORT=7077 SPARK_MASTER_PORT=7077
fi fi
if [ "$SPARK_MASTER_IP" = "" ]; then if [ "$SPARK_MASTER_HOST" = "" ]; then
SPARK_MASTER_IP="`hostname`" SPARK_MASTER_HOST="`hostname`"
fi fi
# Launch the slaves # Launch the slaves
"${SPARK_HOME}/sbin/slaves.sh" cd "${SPARK_HOME}" \; "${SPARK_HOME}/sbin/start-slave.sh" "spark://$SPARK_MASTER_IP:$SPARK_MASTER_PORT" "${SPARK_HOME}/sbin/slaves.sh" cd "${SPARK_HOME}" \; "${SPARK_HOME}/sbin/start-slave.sh" "spark://$SPARK_MASTER_HOST:$SPARK_MASTER_PORT"
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