diff options
Diffstat (limited to 'bin/start-slave.sh')
-rwxr-xr-x | bin/start-slave.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/bin/start-slave.sh b/bin/start-slave.sh new file mode 100755 index 0000000000..45a0cf7a6b --- /dev/null +++ b/bin/start-slave.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +bin=`dirname "$0"` +bin=`cd "$bin"; pwd` + +# Set SPARK_PUBLIC_DNS so slaves can be linked in master web UI +if [ "$SPARK_PUBLIC_DNS" = "" ]; then + # If we appear to be running on EC2, use the public address by default: + if [[ `hostname` == *ec2.internal ]]; then + 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.worker.Worker $1 |