From cdaa0fad51c7ad6c2a56f6c14faedd08fe341b2e Mon Sep 17 00:00:00 2001 From: Josh Rosen Date: Sat, 1 Dec 2012 18:18:15 -0800 Subject: Use external addresses in standalone WebUI on EC2. --- bin/start-master.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'bin/start-master.sh') diff --git a/bin/start-master.sh b/bin/start-master.sh index 6403c944a4..ad19d48331 100755 --- a/bin/start-master.sh +++ b/bin/start-master.sh @@ -7,4 +7,13 @@ bin=`cd "$bin"; pwd` . "$bin/spark-config.sh" -"$bin"/spark-daemon.sh start spark.deploy.master.Master \ No newline at end of file +# 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 -- cgit v1.2.3