Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Fix #2017, support debug mode for master server, standby server, agent #2020

Merged
merged 7 commits into from
Dec 4, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions bin/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ function init_command() {
ALLOW_DAEMON_OPT=true
export SMART_LOG_FILE_NAME=${SMART_AGENT_LOG_FILE_NAME}
export SMART_LOG_FILE=${SMART_LOG_DIR}/${SMART_LOG_FILE_NAME}
if [ $SSM_DEBUG_ENABLED == "true" ]; then
JAVA_OPTS+=" -Xdebug -Xrunjdwp:transport=dt_socket,address=8008,server=y,suspend=y"
fi
JAVA_OPTS+=" -Dsmart.log.file="${SMART_LOG_FILE_NAME}
JAVA_OPST+=" ${SSM_JAVA_OPT} ${SSM_AGENT_JAVA_OPT}"
SMART_VARGS+=" -D smart.agent.address="${SSM_EXEC_HOST}
Expand Down
8 changes: 8 additions & 0 deletions bin/start-agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ bin=$(cd "${bin}">/dev/null; pwd)

AGENT_HOSTS=
while [ $# != 0 ]; do
DEBUG_OPT=""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this statement to the outside of while loop. Please test again after that.

case "$1" in
"--config")
shift
Expand All @@ -47,6 +48,13 @@ while [ $# != 0 ]; do
DEBUG_OPT="$1"
shift
;;
"--help" | "-h")
echo -e "--help -h Show this usage information\n\
--config Specify or overwrite an configure option.\n\
--host Specify the host on which Smart Agent will be started by giving its hostname or IP. \
The default one is localhost. "
shift
;;
*)
break;
;;
Expand Down
11 changes: 9 additions & 2 deletions bin/start-ssm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ while [ $# != 0 ]; do
DEBUG_OPT=$1
shift
;;
"--help" | "-h")
echo -e "--help -h Show this usage information\n\
--config Specify or overwrite an configure option.\n\
-format Format the configured database."
shift
;;
*)
SMART_VARGS+=" $1"
shift
Expand Down Expand Up @@ -80,7 +86,7 @@ if [ x"${SMARTSERVERS}" != x"" ]; then
OTHER_MASTERS=${SMARTSERVERS/${FIRST_MASTER} /}
if [ x"${DEBUG_OPT}" != x"" ]; then
echo
echo " Please attache to SmartServer@${FIRST_MASTER} and resume the execution first!!"
echo " Please attach to SmartServer@${FIRST_MASTER} and resume the execution first!!"
read -n1 -s -p " And then hit any key to continue ... "
echo -e "\n\nStarting other SmartServers on [${OTHER_MASTERS}]"
sleep 1
Expand All @@ -93,7 +99,8 @@ if [ x"${SMARTSERVERS}" != x"" ]; then
--config "${SMART_CONF_DIR}" \
--hosts "${OTHER_MASTERS}" --hostsend \
--daemon start \
smartserver $SMART_VARGS_STANDBY
smartserver $
SMART_VARGS_STANDBY
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that there is no need to put SMART_VARGS_STANDY on a new line.

fi
else
echo "ERROR: No SmartServers configured in 'servers'."
Expand Down