Skip to content

Commit

Permalink
[Improve](start-shell)Optimize fe&be startup
Browse files Browse the repository at this point in the history
Added startup --console option
Modify the original default startup input stream to avoid log loss
  • Loading branch information
CalvinKirs committed Sep 18, 2023
1 parent 67e8951 commit 8b21d84
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 9 additions & 1 deletion bin/start_be.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ OPTS="$(getopt \
-n "$0" \
-o '' \
-l 'daemon' \
-l 'console' \
-- "$@")"

eval set -- "${OPTS}"

RUN_DAEMON=0
RUN_IN_AWS=0
RUN_CONSOLE=0
while true; do
case "$1" in
--daemon)
Expand All @@ -46,6 +48,10 @@ while true; do
RUN_IN_AWS=1
shift
;;
--console)
RUN_CONSOLE=1
shift
;;
--)
shift
break
Expand Down Expand Up @@ -336,7 +342,9 @@ export AWS_MAX_ATTEMPTS=2

if [[ "${RUN_DAEMON}" -eq 1 ]]; then
nohup ${LIMIT:+${LIMIT}} "${DORIS_HOME}/lib/doris_be" "$@" >>"${LOG_DIR}/be.out" 2>&1 </dev/null &
else
elif [[ "${RUN_CONSOLE}" -eq 1 ]]; then
export DORIS_LOG_TO_STDERR=1
${LIMIT:+${LIMIT}} "${DORIS_HOME}/lib/doris_be" "$@" 2>&1 </dev/null
else
${LIMIT:+${LIMIT}} "${DORIS_HOME}/lib/doris_be" "$@" >>"${LOG_DIR}/be.out" 2>&1 </dev/null &
fi
10 changes: 9 additions & 1 deletion bin/start_fe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ OPTS="$(getopt \
-l 'image:' \
-l 'version' \
-l 'metadata_failure_recovery' \
-l 'console' \
-- "$@")"

eval set -- "${OPTS}"

RUN_DAEMON=0
RUN_CONSOLE=0
HELPER=''
IMAGE_PATH=''
IMAGE_TOOL=''
Expand All @@ -49,6 +51,10 @@ while true; do
RUN_DAEMON=1
shift
;;
--console)
RUN_CONSOLE=1
shift
;;
--version)
OPT_VERSION="--version"
shift
Expand Down Expand Up @@ -227,9 +233,11 @@ if [[ "${IMAGE_TOOL}" -eq 1 ]]; then
fi
elif [[ "${RUN_DAEMON}" -eq 1 ]]; then
nohup ${LIMIT:+${LIMIT}} "${JAVA}" ${final_java_opt:+${final_java_opt}} -XX:-OmitStackTraceInFastThrow -XX:OnOutOfMemoryError="kill -9 %p" org.apache.doris.DorisFE ${HELPER:+${HELPER}} "${METADATA_FAILURE_RECOVERY}" "$@" >>"${LOG_DIR}/fe.out" 2>&1 </dev/null &
else
elif [[ "${RUN_CONSOLE}" -eq 1 ]]; then
export DORIS_LOG_TO_STDERR=1
${LIMIT:+${LIMIT}} "${JAVA}" ${final_java_opt:+${final_java_opt}} -XX:-OmitStackTraceInFastThrow -XX:OnOutOfMemoryError="kill -9 %p" org.apache.doris.DorisFE ${HELPER:+${HELPER}} ${OPT_VERSION:+${OPT_VERSION}} "${METADATA_FAILURE_RECOVERY}" "$@" </dev/null
else
${LIMIT:+${LIMIT}} "${JAVA}" ${final_java_opt:+${final_java_opt}} -XX:-OmitStackTraceInFastThrow -XX:OnOutOfMemoryError="kill -9 %p" org.apache.doris.DorisFE ${HELPER:+${HELPER}} ${OPT_VERSION:+${OPT_VERSION}} "$@" >>"${LOG_DIR}/fe.out" 2>&1 </dev/null &
fi

echo $! >"${pidfile}"

0 comments on commit 8b21d84

Please sign in to comment.