2012-08-01 16:17:31 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Run a Spark command on all slave hosts.
|
|
|
|
|
2013-03-06 21:06:32 -05:00
|
|
|
usage="Usage: spark-daemons.sh [--config confdir] [--hosts hostlistfile] [start|stop] command instance-number args..."
|
2012-08-01 16:17:31 -04:00
|
|
|
|
|
|
|
# if no args specified, show usage
|
|
|
|
if [ $# -le 1 ]; then
|
|
|
|
echo $usage
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
bin=`dirname "$0"`
|
|
|
|
bin=`cd "$bin"; pwd`
|
|
|
|
|
|
|
|
. "$bin/spark-config.sh"
|
|
|
|
|
|
|
|
exec "$bin/slaves.sh" cd "$SPARK_HOME" \; "$bin/spark-daemon.sh" "$@"
|