aboutsummaryrefslogtreecommitdiff
path: root/bin/start-slave.sh
blob: 10cce9c17bb3a4224d0ae8da90459cd3722bf4c1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/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
        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.worker.Worker $1