aboutsummaryrefslogtreecommitdiff
path: root/bin/stop-slaves.sh
diff options
context:
space:
mode:
authorkalpit <shahkalpit84@gmail.com>2013-03-06 18:06:32 -0800
committerkalpit <shahkalpit84@gmail.com>2013-03-26 17:49:30 -0700
commitf08db010d3ba4eff132f5c06a087b0c7c2e58576 (patch)
tree6b08dfbbcb05594b7ce2d712d33e105bf9bd214c /bin/stop-slaves.sh
parentf0164e5047f3a023768cdf0515a7a7d1c75ef7c3 (diff)
downloadspark-f08db010d3ba4eff132f5c06a087b0c7c2e58576.tar.gz
spark-f08db010d3ba4eff132f5c06a087b0c7c2e58576.tar.bz2
spark-f08db010d3ba4eff132f5c06a087b0c7c2e58576.zip
added SPARK_WORKER_INSTANCES : allows spawning multiple worker instances/processes on every slave machine
Diffstat (limited to 'bin/stop-slaves.sh')
-rwxr-xr-xbin/stop-slaves.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/bin/stop-slaves.sh b/bin/stop-slaves.sh
index 21c9ebf324..fbfc594472 100755
--- a/bin/stop-slaves.sh
+++ b/bin/stop-slaves.sh
@@ -7,4 +7,14 @@ bin=`cd "$bin"; pwd`
. "$bin/spark-config.sh"
-"$bin"/spark-daemons.sh stop spark.deploy.worker.Worker \ No newline at end of file
+if [ -f "${SPARK_CONF_DIR}/spark-env.sh" ]; then
+ . "${SPARK_CONF_DIR}/spark-env.sh"
+fi
+
+if [ "$SPARK_WORKER_INSTANCES" = "" ]; then
+ "$bin"/spark-daemons.sh stop spark.deploy.worker.Worker 1
+else
+ for ((i=0; i<$SPARK_WORKER_INSTANCES; i++)); do
+ "$bin"/spark-daemons.sh stop spark.deploy.worker.Worker $(( $i + 1 ))
+ done
+fi