You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Licensed to the Apache Software Foundation (ASF) under one
3
+
# or more contributor license agreements. See the NOTICE file
4
+
# distributed with this work for additional information
5
+
# regarding copyright ownership. The ASF licenses this file
6
+
# to you under the Apache License, Version 2.0 (the
7
+
# "License"); you may not use this file except in compliance
8
+
# with the License. You may obtain a copy of the License at
9
+
#
10
+
# http://www.apache.org/licenses/LICENSE-2.0
11
+
#
12
+
# Unless required by applicable law or agreed to in writing,
13
+
# software distributed under the License is distributed on an
14
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+
# KIND, either express or implied. See the License for the
16
+
# specific language governing permissions and limitations
17
+
# under the License.
18
+
19
+
20
+
# the fe query port for mysql.
21
+
FE_QUERY_PORT=${FE_QUERY_PORT:-9030}
22
+
# timeout for probe fe master.
23
+
PROBE_TIMEOUT=60
24
+
# interval time to probe fe.
25
+
PROBE_INTERVAL=2
26
+
# rpc port for fe communicate with be.
27
+
HEARTBEAT_PORT=9050
28
+
# fqdn or ip
29
+
MY_SELF=
30
+
MY_IP=`hostname -i`
31
+
MY_HOSTNAME=`hostname -f`
32
+
DORIS_ROOT=${DORIS_ROOT:-"/opt/apache-doris"}
33
+
# if config secret for basic auth about operate node of doris, the path must be `/etc/basic_auth`. This is set by operator and the key of password must be `password`.
log_stderr "the $DB_ADMIN_USER have exist in doris."
213
+
return 0
214
+
fi
215
+
mysql --connect-timeout 2 -h $master -P$FE_QUERY_PORT -uroot --skip-column-names --batch -e "CREATE USER '$DB_ADMIN_USER' IDENTIFIED BY '$DB_ADMIN_PASSWD';GRANT NODE_PRIV ON *.*.* TO $DB_ADMIN_USER;"2>&1
216
+
log_stderr "created new account and grant NODE_PRIV!"
217
+
218
+
}
219
+
220
+
# check be exist or not, if exist return 0, or register self in fe cluster. when all fe address failed exit script.
221
+
# `xxx1:port,xxx2:port` as parameter to function.
222
+
functioncheck_and_register()
223
+
{
224
+
addrs=$1
225
+
local addrArr=(${addrs//,/ })
226
+
foraddrin${addrArr[@]}
227
+
do
228
+
add_self $addr
229
+
230
+
if [[ $REGISTERED ]];then
231
+
break;
232
+
fi
233
+
done
234
+
235
+
if [[ $REGISTERED ]];then
236
+
return 0
237
+
else
238
+
log_stderr "not find master in fe cluster, please use mysql connect to fe for verfing the master exist and verify domain connectivity with two pods in different node. "
239
+
exit 1
240
+
fi
241
+
}
242
+
243
+
functionwork_load_group_for_cgroup_path() {
244
+
output=$(cat /proc/filesystems | grep cgroup)
245
+
if [ -z"$output" ];then
246
+
log_stderr "[error] The host machine does not have cgroup installed, so the workload group function will be limited."
247
+
exit 1
248
+
fi
249
+
250
+
mkdir -p /sys/fs/cgroup/cpu/doris
251
+
chmod 770 /sys/fs/cgroup/cpu/doris
252
+
chown -R root:root /sys/fs/cgroup/cpu/doris
253
+
254
+
if [[ -f"/sys/fs/cgroup/cgroup.controllers" ]];then
255
+
log_stderr "[info] The host machine cgroup version: v2."
256
+
chmod a+w /sys/fs/cgroup/cgroup.procs
257
+
else
258
+
log_stderr "[info] The host machine cgroup version: v1."
259
+
fi
260
+
}
261
+
262
+
fe_addrs=$1
263
+
if [[ "x$fe_addrs"=="x" ]];then
264
+
echo"need fe address as paramter!"
265
+
echo" Example $0 <fe_addr>"
266
+
exit 1
267
+
fi
268
+
269
+
if [[ "x$ENABLE_WORKLOAD_GROUP"=="xtrue" ]];then
270
+
log_stderr '[info] Enable workload group !'
271
+
work_load_group_for_cgroup_path
272
+
fi
273
+
274
+
update_conf_from_configmap
275
+
# resolve password for root to manage nodes in doris.
276
+
resolve_password_from_secret
277
+
collect_env_info
278
+
#add_self $fe_addr || exit $?
279
+
check_and_register $fe_addrs
280
+
./doris-debug --component be
281
+
log_stderr "run start_be.sh"
282
+
# the server will start in the current terminal session, and the log output and console interaction will be printed to that terminal
283
+
# befor doris 2.0.2 ,doris start with : start_xx.sh
284
+
# sine doris 2.0.2 ,doris start with : start_xx.sh --console doc: https://doris.apache.org/docs/dev/install/standard-deployment/#version--202
0 commit comments