luoshieryi opened a new issue, #16242:
URL: https://github.com/apache/doris/issues/16242

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Version
   
   Doris 1.1.5
   Docker 20.10.17
   
   ### What's Wrong?
   
   在init_be.sh第82行, 以` &`结尾的 registerShell 指令不会在dockerLog中输出日志, 也不会阻塞for循环的运行, 
   会重复执行20次`eval "${registerShell}"`, 并立即终止容器
   
   init_be.sh, line 82~105:
   ```
   registerShell="/opt/apache-doris/be/bin/start_be.sh &"
   echo "DEBUG >>>>>> registerShell = ${registerShell}"
   
   for ((i = 0; i <= 20; i++)); do
   
       ## check be register status
       echo "mysql -uroot -P9030 -h${feIpArray[1]} -e \"show backends\" | grep 
\" ${be_ip} \" | grep \" ${be_heartbeat_port} \""
       mysql -uroot -P9030 -h"${feIpArray[1]}" -e "show backends" | grep 
"[[:space:]]${be_ip}[[:space:]]" | grep 
"[[:space:]]${be_heartbeat_port}[[:space:]]"
       be_join_status=$?
       echo "DEBUG >>>>>> The " "${i}" "time to register BE node, 
be_join_status=${be_join_status}"
       if [[ "${be_join_status}" == 0 ]]; then
           ## be registe successfully
           echo "DEBUG >>>>>> run command ${registerShell}"
           eval "${registerShell}"
       else
           ## be doesn't registe
           echo "DEBUG >>>>>> run commnad ${registerMySQL}"
           eval "${registerMySQL}"
           if [[ "${i}" == 20 ]]; then
               echo "DEBUG >>>>>> BE Start Or Register FAILED!"
           fi
           sleep 5
       fi
   done
   ```
   
   全部日志输出:
   ```
   PS > docker run -p 9060:9060 -p 8040:8040 -p 9050:9050 -p 8060:8060 
doris-be-1.1.5 --fe_servers fe1:192.168.141.13:9010 --be_addr 
192.168.141.13:9050
   DEBUG >>>>>> FE_SERVERS=[fe1:192.168.141.13:9010]
   DEBUG >>>>>> BE_ADDR=[192.168.141.13:9050]
   DEBUG >>>>>> feIpArray = 192.168.141.13
   DEBUG >>>>>> feEditLogPortArray = 9010
   DEBUG >>>>>> masterFe = 192.168.141.13:9010
   DEBUG >>>>>> be_addr = 192.168.141.13:9050
   DEBUG >>>>>> Append the configuration [priority_networks = 192.168.141.0/24] 
to /opt/apache-doris/be/conf/fe.conf
   DEBUG >>>>>> registerMySQL = mysql -uroot -P9030 -h192.168.141.13 -e "alter 
system add backend '192.168.141.13:9050'"
   DEBUG >>>>>> registerShell = /opt/apache-doris/be/bin/start_be.sh &
   mysql -uroot -P9030 -h192.168.141.13 -e "show backends" | grep " 
192.168.141.13 " | grep " 9050 "
   DEBUG >>>>>> The  0 time to register BE node, be_join_status=1
   DEBUG >>>>>> run commnad mysql -uroot -P9030 -h192.168.141.13 -e "alter 
system add backend '192.168.141.13:9050'"
   mysql -uroot -P9030 -h192.168.141.13 -e "show backends" | grep " 
192.168.141.13 " | grep " 9050 "
   10002   default_cluster 192.168.141.13  9050    -1      -1      -1      NULL 
   NULL    false   false   false   0       0.000   1.000 0.000    0.00 %  0.00 
%  {"location" : "default"}        Socket is closed by peer.               
{"lastSuccessReportTabletsTime":"N/A","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false}
   DEBUG >>>>>> The  1 time to register BE node, be_join_status=0
   DEBUG >>>>>> run command /opt/apache-doris/be/bin/start_be.sh &
   mysql -uroot -P9030 -h192.168.141.13 -e "show backends" | grep " 
192.168.141.13 " | grep " 9050 "
   10002   default_cluster 192.168.141.13  9050    -1      -1      -1      NULL 
   NULL    false   false   false   0       0.000   1.000 0.000    0.00 %  0.00 
%  {"location" : "default"}        Socket is closed by peer.               
{"lastSuccessReportTabletsTime":"N/A","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false}
   DEBUG >>>>>> The  2 time to register BE node, be_join_status=0
   DEBUG >>>>>> run command /opt/apache-doris/be/bin/start_be.sh &
   mysql -uroot -P9030 -h192.168.141.13 -e "show backends" | grep " 
192.168.141.13 " | grep " 9050 "
   10002   default_cluster 192.168.141.13  9050    -1      -1      -1      NULL 
   NULL    false   false   false   0       0.000   1.000 0.000    0.00 %  0.00 
%  {"location" : "default"}        Socket is closed by peer.               
{"lastSuccessReportTabletsTime":"N/A","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false}
   DEBUG >>>>>> The  3 time to register BE node, be_join_status=0
   DEBUG >>>>>> run command /opt/apache-doris/be/bin/start_be.sh &
   mysql -uroot -P9030 -h192.168.141.13 -e "show backends" | grep " 
192.168.141.13 " | grep " 9050 "
   10002   default_cluster 192.168.141.13  9050    -1      -1      -1      NULL 
   NULL    false   false   false   0       0.000   1.000 0.000    0.00 %  0.00 
%  {"location" : "default"}        Socket is closed by peer.               
{"lastSuccessReportTabletsTime":"N/A","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false}
   DEBUG >>>>>> The  4 time to register BE node, be_join_status=0
   DEBUG >>>>>> run command /opt/apache-doris/be/bin/start_be.sh &
   mysql -uroot -P9030 -h192.168.141.13 -e "show backends" | grep " 
192.168.141.13 " | grep " 9050 "
   10002   default_cluster 192.168.141.13  9050    -1      -1      -1      NULL 
   NULL    false   false   false   0       0.000   1.000 0.000    0.00 %  0.00 
%  {"location" : "default"}        Socket is closed by peer.               
{"lastSuccessReportTabletsTime":"N/A","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false}
   DEBUG >>>>>> The  5 time to register BE node, be_join_status=0
   DEBUG >>>>>> run command /opt/apache-doris/be/bin/start_be.sh &
   mysql -uroot -P9030 -h192.168.141.13 -e "show backends" | grep " 
192.168.141.13 " | grep " 9050 "
   10002   default_cluster 192.168.141.13  9050    -1      -1      -1      NULL 
   NULL    false   false   false   0       0.000   1.000 0.000    0.00 %  0.00 
%  {"location" : "default"}        Socket is closed by peer.               
{"lastSuccessReportTabletsTime":"N/A","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false}
   DEBUG >>>>>> The  6 time to register BE node, be_join_status=0
   DEBUG >>>>>> run command /opt/apache-doris/be/bin/start_be.sh &
   mysql -uroot -P9030 -h192.168.141.13 -e "show backends" | grep " 
192.168.141.13 " | grep " 9050 "
   10002   default_cluster 192.168.141.13  9050    -1      -1      -1      NULL 
   NULL    false   false   false   0       0.000   1.000 0.000    0.00 %  0.00 
%  {"location" : "default"}        Socket is closed by peer.               
{"lastSuccessReportTabletsTime":"N/A","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false}
   DEBUG >>>>>> The  7 time to register BE node, be_join_status=0
   DEBUG >>>>>> run command /opt/apache-doris/be/bin/start_be.sh &
   mysql -uroot -P9030 -h192.168.141.13 -e "show backends" | grep " 
192.168.141.13 " | grep " 9050 "
   10002   default_cluster 192.168.141.13  9050    -1      -1      -1      NULL 
   NULL    false   false   false   0       0.000   1.000 0.000    0.00 %  0.00 
%  {"location" : "default"}        Socket is closed by peer.               
{"lastSuccessReportTabletsTime":"N/A","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false}
   DEBUG >>>>>> The  8 time to register BE node, be_join_status=0
   DEBUG >>>>>> run command /opt/apache-doris/be/bin/start_be.sh &
   mysql -uroot -P9030 -h192.168.141.13 -e "show backends" | grep " 
192.168.141.13 " | grep " 9050 "
   10002   default_cluster 192.168.141.13  9050    -1      -1      -1      NULL 
   NULL    false   false   false   0       0.000   1.000 0.000    0.00 %  0.00 
%  {"location" : "default"}        Socket is closed by peer.               
{"lastSuccessReportTabletsTime":"N/A","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false}
   DEBUG >>>>>> The  9 time to register BE node, be_join_status=0
   DEBUG >>>>>> run command /opt/apache-doris/be/bin/start_be.sh &
   mysql -uroot -P9030 -h192.168.141.13 -e "show backends" | grep " 
192.168.141.13 " | grep " 9050 "
   10002   default_cluster 192.168.141.13  9050    -1      -1      -1      NULL 
   NULL    false   false   false   0       0.000   1.000 0.000    0.00 %  0.00 
%  {"location" : "default"}        Socket is closed by peer.               
{"lastSuccessReportTabletsTime":"N/A","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false}
   DEBUG >>>>>> The  10 time to register BE node, be_join_status=0
   DEBUG >>>>>> run command /opt/apache-doris/be/bin/start_be.sh &
   mysql -uroot -P9030 -h192.168.141.13 -e "show backends" | grep " 
192.168.141.13 " | grep " 9050 "
   10002   default_cluster 192.168.141.13  9050    -1      -1      -1      NULL 
   NULL    false   false   false   0       0.000   1.000 0.000    0.00 %  0.00 
%  {"location" : "default"}        Socket is closed by peer.               
{"lastSuccessReportTabletsTime":"N/A","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false}
   DEBUG >>>>>> The  11 time to register BE node, be_join_status=0
   DEBUG >>>>>> run command /opt/apache-doris/be/bin/start_be.sh &
   mysql -uroot -P9030 -h192.168.141.13 -e "show backends" | grep " 
192.168.141.13 " | grep " 9050 "
   10002   default_cluster 192.168.141.13  9050    -1      -1      -1      NULL 
   NULL    false   false   false   0       0.000   1.000 0.000    0.00 %  0.00 
%  {"location" : "default"}        Socket is closed by peer.               
{"lastSuccessReportTabletsTime":"N/A","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false}
   DEBUG >>>>>> The  12 time to register BE node, be_join_status=0
   DEBUG >>>>>> run command /opt/apache-doris/be/bin/start_be.sh &
   mysql -uroot -P9030 -h192.168.141.13 -e "show backends" | grep " 
192.168.141.13 " | grep " 9050 "
   10002   default_cluster 192.168.141.13  9050    -1      -1      -1      NULL 
   NULL    false   false   false   0       0.000   1.000 0.000    0.00 %  0.00 
%  {"location" : "default"}        Socket is closed by peer.               
{"lastSuccessReportTabletsTime":"N/A","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false}
   DEBUG >>>>>> The  13 time to register BE node, be_join_status=0
   DEBUG >>>>>> run command /opt/apache-doris/be/bin/start_be.sh &
   mysql -uroot -P9030 -h192.168.141.13 -e "show backends" | grep " 
192.168.141.13 " | grep " 9050 "
   10002   default_cluster 192.168.141.13  9050    -1      -1      -1      NULL 
   NULL    false   false   false   0       0.000   1.000 0.000    0.00 %  0.00 
%  {"location" : "default"}        Socket is closed by peer.               
{"lastSuccessReportTabletsTime":"N/A","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false}
   DEBUG >>>>>> The  14 time to register BE node, be_join_status=0
   DEBUG >>>>>> run command /opt/apache-doris/be/bin/start_be.sh &
   mysql -uroot -P9030 -h192.168.141.13 -e "show backends" | grep " 
192.168.141.13 " | grep " 9050 "
   10002   default_cluster 192.168.141.13  9050    -1      -1      -1      NULL 
   NULL    false   false   false   0       0.000   1.000 0.000    0.00 %  0.00 
%  {"location" : "default"}        Socket is closed by peer.               
{"lastSuccessReportTabletsTime":"N/A","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false}
   DEBUG >>>>>> The  15 time to register BE node, be_join_status=0
   DEBUG >>>>>> run command /opt/apache-doris/be/bin/start_be.sh &
   mysql -uroot -P9030 -h192.168.141.13 -e "show backends" | grep " 
192.168.141.13 " | grep " 9050 "
   10002   default_cluster 192.168.141.13  9050    -1      -1      -1      NULL 
   NULL    false   false   false   0       0.000   1.000 0.000    0.00 %  0.00 
%  {"location" : "default"}        Socket is closed by peer.               
{"lastSuccessReportTabletsTime":"N/A","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false}
   DEBUG >>>>>> The  16 time to register BE node, be_join_status=0
   DEBUG >>>>>> run command /opt/apache-doris/be/bin/start_be.sh &
   mysql -uroot -P9030 -h192.168.141.13 -e "show backends" | grep " 
192.168.141.13 " | grep " 9050 "
   10002   default_cluster 192.168.141.13  9050    -1      -1      -1      NULL 
   NULL    false   false   false   0       0.000   1.000 0.000    0.00 %  0.00 
%  {"location" : "default"}        Socket is closed by peer.               
{"lastSuccessReportTabletsTime":"N/A","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false}
   DEBUG >>>>>> The  17 time to register BE node, be_join_status=0
   DEBUG >>>>>> run command /opt/apache-doris/be/bin/start_be.sh &
   mysql -uroot -P9030 -h192.168.141.13 -e "show backends" | grep " 
192.168.141.13 " | grep " 9050 "
   10002   default_cluster 192.168.141.13  9050    -1      -1      -1      NULL 
   NULL    false   false   false   0       0.000   1.000 0.000    0.00 %  0.00 
%  {"location" : "default"}        Socket is closed by peer.               
{"lastSuccessReportTabletsTime":"N/A","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false}
   DEBUG >>>>>> The  18 time to register BE node, be_join_status=0
   DEBUG >>>>>> run command /opt/apache-doris/be/bin/start_be.sh &
   mysql -uroot -P9030 -h192.168.141.13 -e "show backends" | grep " 
192.168.141.13 " | grep " 9050 "
   10002   default_cluster 192.168.141.13  9050    -1      -1      -1      NULL 
   NULL    false   false   false   0       0.000   1.000 0.000    0.00 %  0.00 
%  {"location" : "default"}        Socket is closed by peer.               
{"lastSuccessReportTabletsTime":"N/A","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false}
   DEBUG >>>>>> The  19 time to register BE node, be_join_status=0
   DEBUG >>>>>> run command /opt/apache-doris/be/bin/start_be.sh &
   mysql -uroot -P9030 -h192.168.141.13 -e "show backends" | grep " 
192.168.141.13 " | grep " 9050 "
   10002   default_cluster 192.168.141.13  9050    -1      -1      -1      NULL 
   NULL    false   false   false   0       0.000   1.000 0.000    0.00 %  0.00 
%  {"location" : "default"}        Socket is closed by peer.               
{"lastSuccessReportTabletsTime":"N/A","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false}
   DEBUG >>>>>> The  20 time to register BE node, be_join_status=0
   DEBUG >>>>>> run command /opt/apache-doris/be/bin/start_be.sh &
   ```
   
   ### What You Expected?
   
   - 修改 registerShell 为 `registerShell="/opt/apache-doris/be/bin/start_be.sh"`
   - 执行 `eval "${registerShell}"` 之后退出循环
   
   
   ### How to Reproduce?
   
   build docker image as 
[construct-docker-image](https://doris.apache.org/zh-CN/docs/dev/install/construct-docker/construct-docker-image),
 then run with 
   `docker run -p 9060:9060 -p 8040:8040 -p 9050:9050 -p 8060:8060 
doris-be-1.1.5 --fe_servers <fe-Id>:<fe-IP>:<fe-EditLogPort> --be_addr 
<be-IP>:9050`
   
   ### Anything Else?
   
   Thank You
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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: commits-unsubscr...@doris.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to