#!/bin/bash

cp /root/spark-ec2/slaves /root/spark/conf/

# Set cluster-url to standalone master
echo "`cat /root/spark-ec2/masters`"":7077" > /root/spark-ec2/cluster-url
/root/spark-ec2/copy-dir /root/spark/conf

# The Spark master seems to take time to start and workers crash if
# they start before the master. Try to see if waiting makes the master start up
# faster.
sleep 10

/root/spark/bin/start-all.sh

#!/bin/bash

cp /root/spark-ec2/slaves /root/spark/conf/

# Set cluster-url to standalone master
echo "spark://""`cat /root/spark-ec2/masters`"":7077" > /root/spark-ec2/cluster-url
/root/spark-ec2/copy-dir /root/spark/conf

# The Spark master seems to take time to start and workers crash if
# they start before the master. Try to see if waiting makes the master start up
# more reliably.
sleep 60

/root/spark/bin/start-all.sh

Fix cluster url and try a larger sleep duration
Fix cluster url and try a larger sleep duration
