This is an automated email from the ASF dual-hosted git repository.

morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 1a553f7e14 [Improve](start-shell)Optimize fe&be startup (#24556)
1a553f7e14 is described below

commit 1a553f7e1484f61a077504036b82a268d60196ec
Author: Calvin Kirs <[email protected]>
AuthorDate: Tue Sep 19 23:00:59 2023 +0800

    [Improve](start-shell)Optimize fe&be startup (#24556)
    
    - sh start_fe/start_be --console is used to instruct the program to run in 
console mode.
    - sh start_fe/start_be --daemon is used to instruct the program to run in 
daemon mode.
    - sh start_fe/start_be used starts as a background execution, records 
output and error logs to the specified file
---
 bin/start_be.sh | 10 +++++++++-
 bin/start_fe.sh | 10 +++++++++-
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/bin/start_be.sh b/bin/start_be.sh
index 9841e57cda..a2f5f399dc 100755
--- a/bin/start_be.sh
+++ b/bin/start_be.sh
@@ -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)
@@ -46,6 +48,10 @@ while true; do
         RUN_IN_AWS=1
         shift
         ;;
+    --console)
+        RUN_CONSOLE=1
+        shift
+        ;;
     --)
         shift
         break
@@ -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
diff --git a/bin/start_fe.sh b/bin/start_fe.sh
index f83ab7ca84..087f2712e0 100755
--- a/bin/start_fe.sh
+++ b/bin/start_fe.sh
@@ -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=''
@@ -49,6 +51,10 @@ while true; do
         RUN_DAEMON=1
         shift
         ;;
+    --console)
+        RUN_CONSOLE=1
+        shift
+        ;;
     --version)
         OPT_VERSION="--version"
         shift
@@ -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}"


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to