Github user NicoK commented on a diff in the pull request:
https://github.com/apache/flink/pull/3298#discussion_r101008339
--- Diff: flink-dist/src/main/flink-bin/bin/stop-cluster.sh ---
@@ -25,14 +25,30 @@ bin=`cd "$bin"; pwd`
# Stop TaskManager instance(s) using pdsh (Parallel Distributed Shell)
when available
readSlaves
-command -v pdsh >/dev/null 2>&1
-if [[ $? -ne 0 ]]; then
+# all-local setup?
+all_localhost=1
+for slave in ${SLAVES[@]}; do
+ if [[ "$slave" != "localhost" ]]; then
+ all_localhost=0
+ break
+ fi
+done
+
+if [[ ${all_localhost} -eq 1 ]]; then
+ # all-local setup
for slave in ${SLAVES[@]}; do
- ssh -n $FLINK_SSH_OPTS $slave -- "nohup /bin/bash -l
\"${FLINK_BIN_DIR}/taskmanager.sh\" stop &"
+ "${FLINK_BIN_DIR}"/taskmanager.sh stop
done
else
- PDSH_SSH_ARGS="" PDSH_SSH_ARGS_APPEND=$FLINK_SSH_OPTS pdsh -w $(IFS=,
; echo "${SLAVES[*]}") \
- "nohup /bin/bash -l \"${FLINK_BIN_DIR}/taskmanager.sh\" stop"
+ command -v pdsh >/dev/null 2>&1
+ if [[ $? -ne 0 ]]; then
+ for slave in ${SLAVES[@]}; do
+ ssh -n $FLINK_SSH_OPTS $slave -- "nohup /bin/bash -l
\"${FLINK_BIN_DIR}/taskmanager.sh\" stop &"
+ done
+ else
+ PDSH_SSH_ARGS="" PDSH_SSH_ARGS_APPEND=$FLINK_SSH_OPTS pdsh -w
$(IFS=, ; echo "${SLAVES[*]}") \
+ "nohup /bin/bash -l \"${FLINK_BIN_DIR}/taskmanager.sh\" stop"
--- End diff --
you're right but it's probably more readable to keep the commands in there
instead of sharing them, also it has been that way before ;)
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---