提交 f7d19115 编写于 作者: G Greg Hogan 提交者: Fabian Hueske

[FLINK-3161] [dist] Externalize cluster start-up and tear-down when available

Parallelizes cluster start-up and tear-down when pdsh is available

This closes #1523
上级 934774f0
......@@ -49,9 +49,15 @@ else
fi
shopt -u nocasematch
# Start TaskManager instance(s)
# Start TaskManager instance(s) using pdsh (Parallel Distributed Shell) when available
readSlaves
for slave in ${SLAVES[@]}; do
ssh -n $FLINK_SSH_OPTS $slave -- "nohup /bin/bash -l \"${FLINK_BIN_DIR}/taskmanager.sh\" start &"
done
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\" start &"
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\" start"
fi
......@@ -22,12 +22,18 @@ bin=`cd "$bin"; pwd`
. "$bin"/config.sh
# Stop TaskManager instance(s)
# Stop TaskManager instance(s) using pdsh (Parallel Distributed Shell) when available
readSlaves
for slave in ${SLAVES[@]}; do
ssh -n $FLINK_SSH_OPTS $slave -- "nohup /bin/bash -l \"${FLINK_BIN_DIR}/taskmanager.sh\" stop &"
done
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"
fi
# Stop JobManager instance(s)
shopt -s nocasematch
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册