ddanielr commented on code in PR #5094:
URL: https://github.com/apache/accumulo/pull/5094#discussion_r1854296826
##########
assemble/bin/accumulo-cluster:
##########
@@ -573,49 +573,32 @@ function stop_all() {
}
function stop_here() {
- # Determine hostname without errors to user
- hosts_to_check=("$(hostname -a 2>/dev/null | head -1)" "$(hostname -f)")
-
if echo "${TSERVER_HOSTS}" | grep -Eq 'localhost|127[.]0[.]0[.]1'; then
+ hosts_to_check="localhost"
+ else
+ # Determine hostname without errors to user
+ hosts_to_check=("$(hostname -a 2>/dev/null | head -1)" "$(hostname -f)")
+ fi
+
+ # Gracefully stop tservers via admin command
+ for tserver in "${hosts_to_check[@]}"; do
if ! isDebug; then
- ${accumulo_cmd} admin stop localhost
+ echo "${accumulo_cmd}" admin stop "$tserver"
else
- debug "Stopping tservers on localhost via admin command"
+ debug "Stopping tservers on $tserver via admin command"
fi
- else
- for host in "${hosts_to_check[@]}"; do
- for tserver in $TSERVER_HOSTS; do
- if echo "$tserver" | grep -q "$host"; then
- if ! isDebug; then
- ${accumulo_cmd} admin stop "$host"
- else
- debug "Stopping tservers on $host via admin command"
- fi
- fi
- done
- done
- fi
+ done
- for host in "${hosts_to_check[@]}"; do
- for end_cmd in "stop" "kill"; do
- for svc in tserver gc manager monitor compaction-coordinator; do
- end_service $end_cmd "$host" $svc
- done
- for group in $SSERVER_GROUPS; do
- var_name="NUM_SSERVERS_${group}"
- [[ -n ${!var_name} ]] && NUM_SSERVERS=${!var_name}
- G="SSERVER_HOSTS_${group}"
- for sserver in ${!G}; do
- end_service $end_cmd "$sserver" sserver "-g" "$group"
Review Comment:
One of the bugs that is fixed is here where `$sserver` is being used instead
of `$host`.
This causes all scan servers to be terminated across the cluster.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]