aboutsummaryrefslogtreecommitdiff
path: root/sbin/start-slaves.sh
diff options
context:
space:
mode:
authorNick Lanham <nick@afternight.org>2014-03-18 22:04:57 -0700
committerPatrick Wendell <pwendell@gmail.com>2014-03-18 22:04:57 -0700
commita18ea00f3af0fa4c6b2c59933e22b6c9f0f636c8 (patch)
treebe8b2783a2a93724bcbbdcf115cbd8f628292ef9 /sbin/start-slaves.sh
parentcc2655a237442a71c75d4fade99767df7648e55f (diff)
downloadspark-a18ea00f3af0fa4c6b2c59933e22b6c9f0f636c8.tar.gz
spark-a18ea00f3af0fa4c6b2c59933e22b6c9f0f636c8.tar.bz2
spark-a18ea00f3af0fa4c6b2c59933e22b6c9f0f636c8.zip
Bundle tachyon: SPARK-1269
This should all work as expected with the current version of the tachyon tarball (0.4.1) Author: Nick Lanham <nick@afternight.org> Closes #137 from nicklan/bundle-tachyon and squashes the following commits: 2eee15b [Nick Lanham] Put back in exec, start tachyon first 738ba23 [Nick Lanham] Move tachyon out of sbin f2f9bc6 [Nick Lanham] More checks for tachyon script 111e8e1 [Nick Lanham] Only try tachyon operations if tachyon script exists 0561574 [Nick Lanham] Copy over web resources so web interface can run 4dc9809 [Nick Lanham] Update to tachyon 0.4.1 0a1a20c [Nick Lanham] Add scripts using tachyon tarball
Diffstat (limited to 'sbin/start-slaves.sh')
-rwxr-xr-xsbin/start-slaves.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/sbin/start-slaves.sh b/sbin/start-slaves.sh
index fd5cdeb1e6..da641cfe3c 100755
--- a/sbin/start-slaves.sh
+++ b/sbin/start-slaves.sh
@@ -20,6 +20,22 @@
sbin=`dirname "$0"`
sbin=`cd "$sbin"; pwd`
+
+START_TACHYON=false
+
+while (( "$#" )); do
+case $1 in
+ --with-tachyon)
+ if [ ! -e "$sbin"/../tachyon/bin/tachyon ]; then
+ echo "Error: --with-tachyon specified, but tachyon not found."
+ exit -1
+ fi
+ START_TACHYON=true
+ ;;
+ esac
+shift
+done
+
. "$sbin/spark-config.sh"
if [ -f "${SPARK_CONF_DIR}/spark-env.sh" ]; then
@@ -35,6 +51,13 @@ if [ "$SPARK_MASTER_IP" = "" ]; then
SPARK_MASTER_IP=`hostname`
fi
+if [ "$START_TACHYON" == "true" ]; then
+ "$sbin/slaves.sh" cd "$SPARK_HOME" \; "$sbin"/../tachyon/bin/tachyon bootstrap-conf $SPARK_MASTER_IP
+
+ # set -t so we can call sudo
+ SPARK_SSH_OPTS="-o StrictHostKeyChecking=no -t" "$sbin/slaves.sh" cd "$SPARK_HOME" \; "$sbin/../tachyon/bin/tachyon-start.sh" worker SudoMount \; sleep 1
+fi
+
# Launch the slaves
if [ "$SPARK_WORKER_INSTANCES" = "" ]; then
exec "$sbin/slaves.sh" cd "$SPARK_HOME" \; "$sbin/start-slave.sh" 1 spark://$SPARK_MASTER_IP:$SPARK_MASTER_PORT