github-actions[bot] commented on PR #14436:
URL: https://github.com/apache/doris/pull/14436#issuecomment-1321481255
#### `sh-checker report`
To get the full details, please check in the
[job]("https://github.com/apache/doris/actions/runs/3511681988") output.
<details>
<summary>shellcheck errors</summary>
```
'shellcheck ' returned error 2 finding the following syntactical issues:
----------
In docker/runtime/be/Dockerfile line 24:
PATH="/opt/apache-doris/be/bin:$PATH"
^---^ SC2250 (style): Prefer putting
braces around variable references even when not strictly required.
Did you mean:
PATH="/opt/apache-doris/be/bin:${PATH}"
In docker/runtime/be/Dockerfile line 27:
ADD ./resource/apache-doris-be-${x.x.x}-bin-x86_64.tar.gz /opt/
^------^ SC2154 (warning): x is referenced
but not assigned.
^------^ SC2086 (info): Double quote to
prevent globbing and word splitting.
Did you mean:
ADD ./resource/apache-doris-be-"${x.x.x}"-bin-x86_64.tar.gz /opt/
In docker/runtime/be/Dockerfile line 35:
mv apache-doris-be-${x.x.x}-bin-x86_64 /opt/apache-doris/be
^------^ SC2086 (info): Double quote to prevent
globbing and word splitting.
Did you mean:
mv apache-doris-be-"${x.x.x}"-bin-x86_64 /opt/apache-doris/be
In docker/runtime/be/resource/run_be.sh line 22:
ARGS=`getopt -o -h: --long fe_servers:,be_addr: -n "$0" -- "$@"`
^-- SC2006 (style): Use $(...) notation instead of legacy backticks
`...`.
Did you mean:
ARGS=$(getopt -o -h: --long fe_servers:,be_addr: -n "$0" -- "$@")
In docker/runtime/be/resource/run_be.sh line 26:
while [ -n "$1" ]
^---------^ SC2292 (style): Prefer [[ ]] over [ ] for tests in
Bash/Ksh.
Did you mean:
while [[ -n "$1" ]]
In docker/runtime/be/resource/run_be.sh line 48:
echo "DEBUG >>>>>> FE_SERVERS=[$FE_SERVERS]"
^---------^ SC2250 (style): Prefer putting
braces around variable references even when not strictly required.
Did you mean:
echo "DEBUG >>>>>> FE_SERVERS=[${FE_SERVERS}]"
In docker/runtime/be/resource/run_be.sh line 49:
echo "DEBUG >>>>>> BE_ADDR=[$BE_ADDR]"
^------^ SC2250 (style): Prefer putting braces
around variable references even when not strictly required.
Did you mean:
echo "DEBUG >>>>>> BE_ADDR=[${BE_ADDR}]"
In docker/runtime/be/resource/run_be.sh line 55:
feServerArray=($FE_SERVERS)
^---------^ SC2206 (warning): Quote to prevent word
splitting/globbing, or split robustly with mapfile or read -a.
^---------^ SC2250 (style): Prefer putting braces around
variable references even when not strictly required.
Did you mean:
feServerArray=(${FE_SERVERS})
In docker/runtime/be/resource/run_be.sh line 61:
tmpFeId=`echo $val | awk -F ':' '{ sub(/fe/, ""); sub(/ /, "");
print$1}'`
^-- SC2006 (style): Use $(...) notation instead of legacy
backticks `...`.
^--^ SC2086 (info): Double quote to prevent globbing and
word splitting.
^--^ SC2250 (style): Prefer putting braces around variable
references even when not strictly required.
Did you mean:
tmpFeId=$(echo "$val" | awk -F ':' '{ sub(/fe/, ""); sub(/ /, "");
print$1}')
In docker/runtime/be/resource/run_be.sh line 62:
tmpFeIp=`echo $val | awk -F ':' '{ sub(/ /, ""); print$2}'`
^-- SC2006 (style): Use $(...) notation instead of legacy
backticks `...`.
^--^ SC2086 (info): Double quote to prevent globbing and
word splitting.
^--^ SC2250 (style): Prefer putting braces around variable
references even when not strictly required.
Did you mean:
tmpFeIp=$(echo "$val" | awk -F ':' '{ sub(/ /, ""); print$2}')
In docker/runtime/be/resource/run_be.sh line 63:
tmpFeEditLogPort=`echo $val | awk -F ':' '{ sub(/ /, ""); print$3}'`
^-- SC2006 (style): Use $(...) notation instead of
legacy backticks `...`.
^--^ SC2086 (info): Double quote to prevent
globbing and word splitting.
^--^ SC2250 (style): Prefer putting braces around
variable references even when not strictly required.
Did you mean:
tmpFeEditLogPort=$(echo "$val" | awk -F ':' '{ sub(/ /, ""); print$3}')
In docker/runtime/be/resource/run_be.sh line 65:
feIpArray[tmpFeId]=$tmpFeIp
^------^ SC2250 (style): Prefer putting braces around
variable references even when not strictly required.
Did you mean:
feIpArray[tmpFeId]=${tmpFeIp}
In docker/runtime/be/resource/run_be.sh line 66:
feEditLogPortArray[tmpFeId]=$tmpFeEditLogPort
^---------------^ SC2250 (style): Prefer
putting braces around variable references even when not strictly required.
Did you mean:
feEditLogPortArray[tmpFeId]=${tmpFeEditLogPort}
In docker/runtime/be/resource/run_be.sh line 70:
be_ip=`echo ${BE_ADDR} | awk -F ':' '{ sub(/ /, ""); print$1}'`
^-- SC2006 (style): Use $(...) notation instead of legacy backticks
`...`.
^--------^ SC2086 (info): Double quote to prevent globbing and
word splitting.
Did you mean:
be_ip=$(echo "${BE_ADDR}" | awk -F ':' '{ sub(/ /, ""); print$1}')
In docker/runtime/be/resource/run_be.sh line 71:
be_heartbeat_port=`echo ${BE_ADDR} | awk -F ':' '{ sub(/ /, ""); print$2}'`
^-- SC2006 (style): Use $(...) notation instead of legacy
backticks `...`.
^--------^ SC2086 (info): Double quote to prevent
globbing and word splitting.
Did you mean:
be_heartbeat_port=$(echo "${BE_ADDR}" | awk -F ':' '{ sub(/ /, "");
print$2}')
In docker/runtime/be/resource/run_be.sh line 74:
echo "DEBUG >>>>>> feIpArray = ${feIpArray[@]}"
^-------------^ SC2145 (error): Argument
mixes string and array. Use * or separate argument.
In docker/runtime/be/resource/run_be.sh line 75:
echo "DEBUG >>>>>> feEditLogPortArray = ${feEditLogPortArray[@]}"
^----------------------^ SC2145
(error): Argument mixes string and array. Use * or separate argument.
In docker/runtime/be/resource/run_be.sh line 79:
priority_networks=`echo ${be_ip} | awk -F '.' '{print$1"."$2"."$3".0/24"}'`
^-- SC2006 (style): Use $(...) notation instead of legacy
backticks `...`.
^------^ SC2086 (info): Double quote to prevent
globbing and word splitting.
Did you mean:
priority_networks=$(echo "${be_ip}" | awk -F '.'
'{print$1"."$2"."$3".0/24"}')
In docker/runtime/be/resource/run_be.sh line 80:
echo "DEBUG >>>>>> Append the configuration [priority_networks =
$priority_networks] to /opt/apache-doris/be/conf/fe.conf"
^----------------^ SC2250 (style): Prefer putting braces around variable
references even when not strictly required.
Did you mean:
echo "DEBUG >>>>>> Append the configuration [priority_networks =
${priority_networks}] to /opt/apache-doris/be/conf/fe.conf"
In docker/runtime/be/resource/run_be.sh line 81:
echo "priority_networks = $priority_networks" >>
/opt/apache-doris/be/conf/be.conf
^----------------^ SC2250 (style): Prefer putting
braces around variable references even when not strictly required.
Did you mean:
echo "priority_networks = ${priority_networks}" >>
/opt/apache-doris/be/conf/be.conf
In docker/runtime/be/resource/run_be.sh line 83:
registerMySQL=`echo "mysql -uroot -P9030 -h${feIpArray[1]} -e" "\"alter
system add backend '${be_ip}:${be_heartbeat_port}'\""`
^-- SC2006 (style): Use $(...) notation instead of legacy
backticks `...`.
^-- SC2116 (style): Useless echo? Instead of 'cmd $(echo
foo)', just use 'cmd foo'.
Did you mean:
registerMySQL=$(echo "mysql -uroot -P9030 -h${feIpArray[1]} -e" "\"alter
system add backend '${be_ip}:${be_heartbeat_port}'\"")
In docker/runtime/be/resource/run_be.sh line 86:
echo "DEBUG >>>>>> registerMySQL = $registerMySQL"
^------------^ SC2250 (style): Prefer
putting braces around variable references even when not strictly required.
Did you mean:
echo "DEBUG >>>>>> registerMySQL = ${registerMySQL}"
In docker/runtime/be/resource/run_be.sh line 87:
echo "DEBUG >>>>>> registerShell = $registerShell"
^------------^ SC2250 (style): Prefer
putting braces around variable references even when not strictly required.
Did you mean:
echo "DEBUG >>>>>> registerShell = ${registerShell}"
In docker/runtime/be/resource/run_be.sh line 92:
echo "DEBUG >>>>>> The " $i "time to register BE node,
be_join_status=$be_join_status"
^-- SC2086 (info): Double quote to prevent
globbing and word splitting.
^-- SC2250 (style): Prefer putting braces
around variable references even when not strictly required.
^-------------^ SC2250 (style): Prefer putting braces around variable
references even when not strictly required.
Did you mean:
echo "DEBUG >>>>>> The " "$i" "time to register BE node,
be_join_status=$be_join_status"
In docker/runtime/be/resource/run_be.sh line 96:
mysql -uroot -P9030 -h${feIpArray[1]} -e "show backends" | grep
"[[:space:]]${be_ip}[[:space:]]" | grep
"[[:space:]]${be_heartbeat_port}[[:space:]]"
^-------------^ SC2086 (info): Double quote to
prevent globbing and word splitting.
Did you mean:
mysql -uroot -P9030 -h"${feIpArray[1]}" -e "show backends" | grep
"[[:space:]]${be_ip}[[:space:]]" | grep
"[[:space:]]${be_heartbeat_port}[[:space:]]"
In docker/runtime/be/resource/run_be.sh line 98:
echo "DEBUG >>>>>> be_join_status = $be_join_status"
^-------------^ SC2250 (style):
Prefer putting braces around variable references even when not strictly
required.
Did you mean:
echo "DEBUG >>>>>> be_join_status = ${be_join_status}"
In docker/runtime/be/resource/run_be.sh line 99:
if [[ "$be_join_status" == 0 ]]; then
^-------------^ SC2250 (style): Prefer putting braces around
variable references even when not strictly required.
Did you mean:
if [[ "${be_join_status}" == 0 ]]; then
In docker/runtime/be/resource/run_be.sh line 102:
eval ${registerShell}
^--------------^ SC2248 (style): Prefer double quoting even
when variables don't contain special characters.
Did you mean:
eval "${registerShell}"
In docker/runtime/be/resource/run_be.sh line 106:
eval ${registerMySQL}
^--------------^ SC2086 (info): Double quote to prevent
globbing and word splitting.
Did you mean:
eval "${registerMySQL}"
In docker/runtime/fe/Dockerfile line 24:
PATH="/opt/apache-doris/fe/bin:$PATH"
^---^ SC2250 (style): Prefer putting
braces around variable references even when not strictly required.
Did you mean:
PATH="/opt/apache-doris/fe/bin:${PATH}"
In docker/runtime/fe/Dockerfile line 27:
ADD ./resource/apache-doris-fe-${x.x.x}-bin.tar.gz /opt/
^------^ SC2154 (warning): x is referenced
but not assigned.
^------^ SC2086 (info): Double quote to
prevent globbing and word splitting.
Did you mean:
ADD ./resource/apache-doris-fe-"${x.x.x}"-bin.tar.gz /opt/
In docker/runtime/fe/Dockerfile line 35:
mv apache-doris-fe-${x.x.x}-bin /opt/apache-doris/fe
^------^ SC2086 (info): Double quote to prevent
globbing and word splitting.
Did you mean:
mv apache-doris-fe-"${x.x.x}"-bin /opt/apache-doris/fe
In docker/runtime/fe/resource/run_fe.sh line 22:
ARGS=`getopt -o -h: --long fe_id:,fe_servers: -n "$0" -- "$@"`
^-- SC2006 (style): Use $(...) notation instead of legacy backticks
`...`.
Did you mean:
ARGS=$(getopt -o -h: --long fe_id:,fe_servers: -n "$0" -- "$@")
In docker/runtime/fe/resource/run_fe.sh line 26:
while [ -n "$1" ]
^---------^ SC2292 (style): Prefer [[ ]] over [ ] for tests in
Bash/Ksh.
Did you mean:
while [[ -n "$1" ]]
In docker/runtime/fe/resource/run_fe.sh line 47:
echo "DEBUG >>>>>> FE_ID = [$FE_ID]"
^----^ SC2250 (style): Prefer putting braces
around variable references even when not strictly required.
Did you mean:
echo "DEBUG >>>>>> FE_ID = [${FE_ID}]"
In docker/runtime/fe/resource/run_fe.sh line 48:
echo "DEBUG >>>>>> FE_SERVERS = [$FE_SERVERS]"
^---------^ SC2250 (style): Prefer putting
braces around variable references even when not strictly required.
Did you mean:
echo "DEBUG >>>>>> FE_SERVERS = [${FE_SERVERS}]"
In docker/runtime/fe/resource/run_fe.sh line 54:
feServerArray=($FE_SERVERS)
^---------^ SC2206 (warning): Quote to prevent word
splitting/globbing, or split robustly with mapfile or read -a.
^---------^ SC2250 (style): Prefer putting braces around
variable references even when not strictly required.
Did you mean:
feServerArray=(${FE_SERVERS})
In docker/runtime/fe/resource/run_fe.sh line 61:
tmpFeId=`echo $val | awk -F ':' '{ sub(/fe/, ""); sub(/ /, "");
print$1}'`
^-- SC2006 (style): Use $(...) notation instead of legacy
backticks `...`.
^--^ SC2086 (info): Double quote to prevent globbing and
word splitting.
^--^ SC2250 (style): Prefer putting braces around variable
references even when not strictly required.
Did you mean:
tmpFeId=$(echo "$val" | awk -F ':' '{ sub(/fe/, ""); sub(/ /, "");
print$1}')
In docker/runtime/fe/resource/run_fe.sh line 62:
tmpFeIp=`echo $val | awk -F ':' '{ sub(/ /, ""); print$2}'`
^-- SC2006 (style): Use $(...) notation instead of legacy
backticks `...`.
^--^ SC2086 (info): Double quote to prevent globbing and
word splitting.
^--^ SC2250 (style): Prefer putting braces around variable
references even when not strictly required.
Did you mean:
tmpFeIp=$(echo "$val" | awk -F ':' '{ sub(/ /, ""); print$2}')
In docker/runtime/fe/resource/run_fe.sh line 63:
tmpFeEditLogPort=`echo $val | awk -F ':' '{ sub(/ /, ""); print$3}'`
^-- SC2006 (style): Use $(...) notation instead of
legacy backticks `...`.
^--^ SC2086 (info): Double quote to prevent
globbing and word splitting.
^--^ SC2250 (style): Prefer putting braces around
variable references even when not strictly required.
Did you mean:
tmpFeEditLogPort=$(echo "$val" | awk -F ':' '{ sub(/ /, ""); print$3}')
In docker/runtime/fe/resource/run_fe.sh line 64:
echo "DEBUG >>>>>> tmpFeId = [$tmpFeId]"
^------^ SC2250 (style): Prefer putting
braces around variable references even when not strictly required.
Did you mean:
echo "DEBUG >>>>>> tmpFeId = [${tmpFeId}]"
In docker/runtime/fe/resource/run_fe.sh line 65:
echo "DEBUG >>>>>> tmpFeIp = [$tmpFeIp]"
^------^ SC2250 (style): Prefer putting
braces around variable references even when not strictly required.
Did you mean:
echo "DEBUG >>>>>> tmpFeIp = [${tmpFeIp}]"
In docker/runtime/fe/resource/run_fe.sh line 66:
echo "DEBUG >>>>>> tmpFeEditLogPort = [$tmpFeEditLogPort]"
^---------------^ SC2250 (style):
Prefer putting braces around variable references even when not strictly
required.
Did you mean:
echo "DEBUG >>>>>> tmpFeEditLogPort = [${tmpFeEditLogPort}]"
In docker/runtime/fe/resource/run_fe.sh line 68:
feIpArray[tmpFeId]=$tmpFeIp
^------^ SC2250 (style): Prefer putting braces around
variable references even when not strictly required.
Did you mean:
feIpArray[tmpFeId]=${tmpFeIp}
In docker/runtime/fe/resource/run_fe.sh line 69:
feEditLogPortArray[tmpFeId]=$tmpFeEditLogPort
^---------------^ SC2250 (style): Prefer
putting braces around variable references even when not strictly required.
Did you mean:
feEditLogPortArray[tmpFeId]=${tmpFeEditLogPort}
In docker/runtime/fe/resource/run_fe.sh line 73:
echo "DEBUG >>>>>> feIpArray = ${feIpArray[@]}"
^-------------^ SC2145 (error): Argument
mixes string and array. Use * or separate argument.
In docker/runtime/fe/resource/run_fe.sh line 74:
echo "DEBUG >>>>>> feEditLogPortArray = ${feEditLogPortArray[@]}"
^----------------------^ SC2145
(error): Argument mixes stridocker/runtime/fe/resource/run_fe.sh: <stdout>:
commitBuffer: invalid argument (invalid character)
ng and array. Use * or separate argument.
In docker/runtime/fe/resource/run_fe.sh line 79:
priority_networks=`echo ${feIpArray[FE_ID]} | awk -F '.'
'{print$1"."$2"."$3".0/24"}'`
^-- SC2006 (style): Use $(...) notation instead of legacy
backticks `...`.
^-----------------^ SC2086 (info): Double quote to
prevent globbing and word splitting.
Did you mean:
priority_networks=$(echo "${feIpArray[FE_ID]}" | awk -F '.'
'{print$1"."$2"."$3".0/24"}')
In docker/runtime/fe/resource/run_fe.sh line 80:
echo "DEBUG >>>>>> Append the configuration [priority_networks =
$priority_networks] to /opt/doris-fe/conf/fe.conf"
^----------------^ SC2250 (style): Prefer putting braces around variable
references even when not strictly required.
Did you mean:
echo "DEBUG >>>>>> Append the configuration [priority_networks =
${priority_networks}] to /opt/doris-fe/conf/fe.conf"
In docker/runtime/fe/resource/run_fe.sh line 81:
echo "priority_networks = $priority_networks" >>
/opt/apache-doris/fe/conf/fe.conf
^----------------^ SC2250 (style): Prefer putting
braces around variable references even when not strictly required.
Did you mean:
echo "priority_networks = ${priority_networks}" >>
/opt/apache-doris/fe/conf/fe.conf
In docker/runtime/fe/resource/run_fe.sh line 83:
if [[ "$FE_ID" != 1 ]]; then
^----^ SC2250 (style): Prefer putting braces around variable
references even when not strictly required.
Did you mean:
if [[ "${FE_ID}" != 1 ]]; then
In docker/runtime/fe/resource/run_fe.sh line 92:
registerMySQL=`echo "mysql -uroot -P9030 -h${feIpArray[1]} -e" "\"alter
system add follower '${feIpArray[FE_ID]}:${feEditLogPortArray[FE_ID]}'\""`
^-- SC2006 (style): Use $(...) notation instead of legacy
backticks `...`.
^-- SC2116 (style): Useless echo? Instead of 'cmd $(echo
foo)', just use 'cmd foo'.
Did you mean:
registerMySQL=$(echo "mysql -uroot -P9030 -h${feIpArray[1]} -e" "\"alter
system add follower '${feIpArray[FE_ID]}:${feEditLogPortArray[FE_ID]}'\"")
In docker/runtime/fe/resource/run_fe.sh line 97:
echo "DEBUG >>>>>> FE is follower, fe_id = $FE_ID"
^----^ SC2250 (style): Prefer
putting braces around variable references even when not strictly required.
Did you mean:
echo "DEBUG >>>>>> FE is follower, fe_id = ${FE_ID}"
In docker/runtime/fe/resource/run_fe.sh line 98:
echo "DEBUG >>>>>> registerMySQL = For more information:
https://www.shellcheck.net/wiki/SC2145 -- Argument mixes string and array.
...
https://www.shellcheck.net/wiki/SC2154 -- x is referenced but not assigned.
https://www.shellcheck.net/wiki/SC2206 -- Quote to prevent word
splitting/g...
----------
You can address the above issues in one of three ways:
1. Manually correct the issue in the offending shell script;
2. Disable specific issues by adding the comment:
# shellcheck disable=NNNN
above the line that contains the issue, where NNNN is the error code;
3. Add '-e NNNN' to the SHELLCHECK_OPTS setting in your .yml action file.
```
</details>
<details>
<summary>shfmt errors</summary>
```
'shfmt ' returned error 1 finding the following formatting issues:
----------
docker/runtime/be/Dockerfile:27:34: invalid parameter name
--- docker/runtime/be/resource/run_be.sh.orig
+++ docker/runtime/be/resource/run_be.sh
@@ -19,27 +19,26 @@
FE_SERVERS=""
BE_ADDR=""
-ARGS=`getopt -o -h: --long fe_servers:,be_addr: -n "$0" -- "$@"`
+ARGS=$(getopt -o -h: --long fe_servers:,be_addr: -n "$0" -- "$@")
eval set -- "${ARGS}"
-while [ -n "$1" ]
-do
+while [ -n "$1" ]; do
case "$1" in
- --fe_servers)
- FE_SERVERS=$2
- shift
- ;;
- --be_addr)
- BE_ADDR=$2
- shift
- ;;
- --)
- ;;
- *)
- echo "Error option $1"
- break
- ;;
+ --fe_servers)
+ FE_SERVERS=$2
+ shift
+ ;;
+ --be_addr)
+ BE_ADDR=$2
+ shift
+ ;;
+ --) ;;
+
+ *)
+ echo "Error option $1"
+ break
+ ;;
esac
shift
done
@@ -58,37 +57,34 @@
val=${feServerArray[i]}
val=${val// /}
#echo "DEBUG >>>>>>>>> $i => 【$val】"
- tmpFeId=`echo $val | awk -F ':' '{ sub(/fe/, ""); sub(/ /, "");
print$1}'`
- tmpFeIp=`echo $val | awk -F ':' '{ sub(/ /, ""); print$2}'`
- tmpFeEditLogPort=`echo $val | awk -F ':' '{ sub(/ /, ""); print$3}'`
+ tmpFeId=$(echo $val | awk -F ':' '{ sub(/fe/, ""); sub(/ /, "");
print$1}')
+ tmpFeIp=$(echo $val | awk -F ':' '{ sub(/ /, ""); print$2}')
+ tmpFeEditLogPort=$(echo $val | awk -F ':' '{ sub(/ /, ""); print$3}')
#echo "DEBUG >>>>>>>>> tmpFeId = $tmpFeIdi, tmpFeIp = $tmpFeIp,
tmpFeEditLogPort = $tmpFeEditLogPort"
feIpArray[tmpFeId]=$tmpFeIp
feEditLogPortArray[tmpFeId]=$tmpFeEditLogPort
done
+be_ip=$(echo ${BE_ADDR} | awk -F ':' '{ sub(/ /, ""); print$1}')
+be_heartbeat_port=$(echo ${BE_ADDR} | awk -F ':' '{ sub(/ /, ""); print$2}')
-be_ip=`echo ${BE_ADDR} | awk -F ':' '{ sub(/ /, ""); print$1}'`
-be_heartbeat_port=`echo ${BE_ADDR} | awk -F ':' '{ sub(/ /, ""); print$2}'`
-
-
echo "DEBUG >>>>>> feIpArray = ${feIpArray[@]}"
echo "DEBUG >>>>>> feEditLogPortArray = ${feEditLogPortArray[@]}"
echo "DEBUG >>>>>> masterFe = ${feIpArray[1]}:${feEditLogPortArray[1]}"
echo "DEBUG >>>>>> be_addr = ${be_ip}:${be_heartbeat_port}"
-priority_networks=`echo ${be_ip} | awk -F '.' '{print$1"."$2"."$3".0/24"}'`
+priority_networks=$(echo ${be_ip} | awk -F '.' '{print$1"."$2"."$3".0/24"}')
echo "DEBUG >>>>>> Append the configuration [priority_networks =
$priority_networks] to /opt/apache-doris/be/conf/fe.conf"
-echo "priority_networks = $priority_networks" >>
/opt/apache-doris/be/conf/be.conf
+echo "priority_networks = $priority_networks"
>>/opt/apache-doris/be/conf/be.conf
-registerMySQL=`echo "mysql -uroot -P9030 -h${feIpArray[1]} -e" "\"alter
system add backend '${be_ip}:${be_heartbeat_port}'\""`
+registerMySQL=$(echo "mysql -uroot -P9030 -h${feIpArray[1]} -e" "\"alter
system add backend '${be_ip}:${be_heartbeat_port}'\"")
registerShell="/opt/apache-doris/be/bin/start_be.sh"
echo "DEBUG >>>>>> registerMySQL = $registerMySQL"
echo "DEBUG >>>>>> registerShell = $registerShell"
+for ((i = 0; i <= 20; i++)); do
-for (( i=0; i<=20; i++)); do
-
echo "DEBUG >>>>>> The " $i "time to register BE node,
be_join_status=$be_join_status"
## check be register status
docker/runtime/fe/Dockerfile:27:34: invalid parameter name
--- docker/runtime/fe/resource/run_fe.sh.orig
+++ docker/runtime/fe/resource/run_fe.sh
@@ -19,27 +19,26 @@
FE_ID=0
FE_SERVERS=""
-ARGS=`getopt -o -h: --long fe_id:,fe_servers: -n "$0" -- "$@"`
+ARGS=$(getopt -o -h: --long fe_id:,fe_servers: -n "$0" -- "$@")
eval set -- "${ARGS}"
-while [ -n "$1" ]
-do
+while [ -n "$1" ]; do
case "$1" in
- --fe_id)
- FE_ID=$2
- shift
- ;;
- --fe_servers)
- FE_SERVERS=$2
- shift
- ;;
- --)
- ;;
- *)
- echo "Error option $1"
- break
- ;;
+ --fe_id)
+ FE_ID=$2
+ shift
+ ;;
+ --fe_servers)
+ FE_SERVERS=$2
+ shift
+ ;;
+ --) ;;
+
+ *)
+ echo "Error option $1"
+ break
+ ;;
esac
shift
done
@@ -58,9 +57,9 @@
val=${feServerArray[i]}
val=${val// /}
#echo "DEBUG >>>>>>>>> $i => 【$val】"
- tmpFeId=`echo $val | awk -F ':' '{ sub(/fe/, ""); sub(/ /, "");
print$1}'`
- tmpFeIp=`echo $val | awk -F ':' '{ sub(/ /, ""); print$2}'`
- tmpFeEditLogPort=`echo $val | awk -F ':' '{ sub(/ /, ""); print$3}'`
+ tmpFeId=$(echo $val | awk -F ':' '{ sub(/fe/, ""); sub(/ /, "");
print$1}')
+ tmpFeIp=$(echo $val | awk -F ':' '{ sub(/ /, ""); print$2}')
+ tmpFeEditLogPort=$(echo $val | awk -F ':' '{ sub(/ /, ""); print$3}')
echo "DEBUG >>>>>> tmpFeId = [$tmpFeId]"
echo "DEBUG >>>>>> tmpFeIp = [$tmpFeIp]"
echo "DEBUG >>>>>> tmpFeEditLogPort = [$tmpFeEditLogPort]"
@@ -75,10 +74,9 @@
echo "DEBUG >>>>>> masterFe = ${feIpArray[1]}:${feEditLogPortArray[1]}"
echo "DEBUG >>>>>> currentFe =
${feIpArray[FE_ID]}:${feEditLogPortArray[FE_ID]}"
-
-priority_networks=`echo ${feIpArray[FE_ID]} | awk -F '.'
'{print$1"."$2"."$3".0/24"}'`
+priority_networks=$(echo ${feIpArray[FE_ID]} | awk -F '.'
'{print$1"."$2"."$3".0/24"}')
echo "DEBUG >>>>>> Append the configuration [priority_networks =
$priority_networks] to /opt/doris-fe/conf/fe.conf"
-echo "priority_networks = $priority_networks" >>
/opt/apache-doris/fe/conf/fe.conf
+echo "priority_networks = $priority_networks"
>>/opt/apache-doris/fe/conf/fe.conf
if [[ "$FE_ID" != 1 ]]; then
@@ -89,7 +87,7 @@
## STEP2: if feMasterStat == true; register PREPARE1 & PREPARE2 [retry
3 times, sleep 10s]
## PREPARE1: registe follower from mysql client
- registerMySQL=`echo "mysql -uroot -P9030 -h${feIpArray[1]} -e" "\"alter
system add follower '${feIpArray[FE_ID]}:${feEditLogPortArray[FE_ID]}'\""`
+ registerMySQL=$(echo "mysql -uroot -P9030 -h${feIpArray[1]} -e"
"\"alter system add follower
'${feIpArray[FE_ID]}:${feEditLogPortArray[FE_ID]}'\"")
## PREPARE2: call start_fe.sh using --help optional
registerShell="/opt/apache-doris/fe/bin/start_fe.sh --helper
'${feIpArray[1]}:${feEditLogPortArray[1]}'"
@@ -101,7 +99,7 @@
## STEP1: check FE master status
- for (( i=0; i<=2000; i++)); do
+ for ((i = 0; i <= 2000; i++)); do
## run STEP1 & STEP2, and then break
echo "Run registerShell command, [ registerMySQL = ${registerMySQL}
]"
----------
You can reformat the above files to meet shfmt's requirements by typing:
shfmt -w filename
```
</details>
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]