diff options
author | Josh Rosen <joshrosen@eecs.berkeley.edu> | 2012-12-14 01:19:00 +0000 |
---|---|---|
committer | Josh Rosen <joshrosen@eecs.berkeley.edu> | 2012-12-14 01:20:00 +0000 |
commit | 1948f46093d2934284daeae06cc2891541c39e68 (patch) | |
tree | 95a73168c599effef49be72eea938837460772d2 /bin/start-master.sh | |
parent | 8fd374dfb2dad636b119954940a11b332678e098 (diff) | |
download | spark-1948f46093d2934284daeae06cc2891541c39e68.tar.gz spark-1948f46093d2934284daeae06cc2891541c39e68.tar.bz2 spark-1948f46093d2934284daeae06cc2891541c39e68.zip |
Use spark-env.sh to configure standalone master. See SPARK-638.
Also fixed a typo in the standalone mode documentation.
Diffstat (limited to 'bin/start-master.sh')
-rwxr-xr-x | bin/start-master.sh | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/bin/start-master.sh b/bin/start-master.sh index ad19d48331..a901b1c260 100755 --- a/bin/start-master.sh +++ b/bin/start-master.sh @@ -7,13 +7,28 @@ bin=`cd "$bin"; pwd` . "$bin/spark-config.sh" +if [ -f "${SPARK_CONF_DIR}/spark-env.sh" ]; then + . "${SPARK_CONF_DIR}/spark-env.sh" +fi + +if [ "$SPARK_MASTER_PORT" = "" ]; then + SPARK_MASTER_PORT=7077 +fi + +if [ "$SPARK_MASTER_IP" = "" ]; then + SPARK_MASTER_IP=`hostname` +fi + +if [ "$SPARK_MASTER_WEBUI_PORT" = "" ]; then + SPARK_MASTER_WEBUI_PORT=8080 +fi + # Set SPARK_PUBLIC_DNS so the master report the correct webUI address to the slaves if [ "$SPARK_PUBLIC_DNS" = "" ]; then # If we appear to be running on EC2, use the public address by default: if [[ `hostname` == *ec2.internal ]]; then - echo "RUNNING ON EC2" export SPARK_PUBLIC_DNS=`wget -q -O - http://instance-data.ec2.internal/latest/meta-data/public-hostname` fi fi -"$bin"/spark-daemon.sh start spark.deploy.master.Master +"$bin"/spark-daemon.sh start spark.deploy.master.Master --ip $SPARK_MASTER_IP --port $SPARK_MASTER_PORT --webui-port $SPARK_MASTER_WEBUI_PORT |