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

yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new 980f28f9e2f [feat](docker)Modify the init_be and start_be scripts to 
meet the requirements for rapid Docker startup(Merge 2.1). (#45858)
980f28f9e2f is described below

commit 980f28f9e2fa21116168fa424437486ba0a722df
Author: FreeOnePlus <54164178+freeonep...@users.noreply.github.com>
AuthorDate: Wed Dec 25 12:11:14 2024 +0800

    [feat](docker)Modify the init_be and start_be scripts to meet the 
requirements for rapid Docker startup(Merge 2.1). (#45858)
    
    ### What problem does this PR solve?
    
    Issue Number: close #xxx
    
    Related PR: #45267
    
    Master PR: #45269
    
    Problem Summary:
    
    To meet the needs of rapid Docker startup, I have made adjustments to
    two related scripts in the Docker startup process. First, I added a env
    `SKIP_CHECK_ULIMIT` to the `start_be.sh` script, which will skip the
    size checks for `swap`, `ulimit`, and `max_map_count`. At the same time,
    I used `--console` to start the process and print logs. The reason why I
    did not use the `--daemon` daemon command to execute is that starting
    with a foreground log printing method in a Docker container is the
    correct and reliable approach.
    
    At the same time, I added a check logic for a `be.conf` configuration
    item in the `init_be.sh` script: if it is the first time starting,
    append the export `SKIP_CHECK_ULIMIT=true` to skip the `ulimit` value
    check in the BE process. In summary, these adjustments can meet the
    basic requirements for rapid Docker startup usage.
---
 bin/start_be.sh                       | 37 ++++++++++++++++++-----------------
 docker/runtime/be/resource/init_be.sh |  1 +
 2 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/bin/start_be.sh b/bin/start_be.sh
index ed5c47b03df..46aa924ca3b 100755
--- a/bin/start_be.sh
+++ b/bin/start_be.sh
@@ -64,29 +64,30 @@ DORIS_HOME="$(
 )"
 export DORIS_HOME
 
-if [[ "$(uname -s)" != 'Darwin' ]]; then
-    MAX_MAP_COUNT="$(cat /proc/sys/vm/max_map_count)"
-    if [[ "${MAX_MAP_COUNT}" -lt 2000000 ]]; then
-        echo "Please set vm.max_map_count to be 2000000 under root using 
'sysctl -w vm.max_map_count=2000000'."
-        exit 1
+if [[ "${SKIP_CHECK_ULIMIT:- "false"}" != "true" ]]; then
+    if [[ "$(uname -s)" != 'Darwin' ]]; then
+        MAX_MAP_COUNT="$(cat /proc/sys/vm/max_map_count)"
+        if [[ "${MAX_MAP_COUNT}" -lt 2000000 ]]; then
+            echo "Please set vm.max_map_count to be 2000000 under root using 
'sysctl -w vm.max_map_count=2000000'."
+            exit 1
+        fi
+
+        if [[ "$(swapon -s | wc -l)" -gt 1 ]]; then
+            echo "Please disable swap memory before installation."
+            exit 1
+        fi
     fi
 
-    if [[ "$(swapon -s | wc -l)" -gt 1 ]]; then
-        echo "Please disable swap memory before installation."
+    MAX_FILE_COUNT="$(ulimit -n)"
+    if [[ "${MAX_FILE_COUNT}" -lt 60000 ]]; then
+        echo "Set max number of open file descriptors to a value greater than 
60000."
+        echo "Ask your system manager to modify /etc/security/limits.conf and 
append content like"
+        echo "  * soft nofile 655350"
+        echo "  * hard nofile 655350"
+        echo "and then run 'ulimit -n 655350' to take effect on current 
session."
         exit 1
     fi
 fi
-
-MAX_FILE_COUNT="$(ulimit -n)"
-if [[ "${MAX_FILE_COUNT}" -lt 60000 ]]; then
-    echo "Set max number of open file descriptors to a value greater than 
60000."
-    echo "Ask your system manager to modify /etc/security/limits.conf and 
append content like"
-    echo "  * soft nofile 655350"
-    echo "  * hard nofile 655350"
-    echo "and then run 'ulimit -n 655350' to take effect on current session."
-    exit 1
-fi
-
 # add java libs
 # Must add hadoop libs, because we should load specified jars
 # instead of jars in hadoop libs, such as avro
diff --git a/docker/runtime/be/resource/init_be.sh 
b/docker/runtime/be/resource/init_be.sh
index 42afd1f6754..996453bcedf 100644
--- a/docker/runtime/be/resource/init_be.sh
+++ b/docker/runtime/be/resource/init_be.sh
@@ -161,6 +161,7 @@ _main() {
     fi
     check_be_status
     doris_note "Ready to start BE!"
+    export SKIP_CHECK_ULIMIT=true
     ${DORIS_HOME}/be/bin/start_be.sh --console &
     child_pid=$!
     wait $child_pid


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to