diff --git a/inlong-sort/sort-end-to-end-tests/sort-end-to-end-tests-v1.18/src/test/resources/docker/starrocks/start_fe_be.sh b/inlong-sort/sort-end-to-end-tests/sort-end-to-end-tests-v1.18/src/test/resources/docker/starrocks/start_fe_be.sh new file mode 100644 index 00000000000..2a8743f9fc9 --- /dev/null +++ b/inlong-sort/sort-end-to-end-tests/sort-end-to-end-tests-v1.18/src/test/resources/docker/starrocks/start_fe_be.sh @@ -0,0 +1,72 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +#!/bin/bash + +log_stdin() +{ + echo "[`date`] $@" >&1 +} +log_stdin `cat /etc/hosts` + +cp /etc/hosts /etc/hosts.temp +sed -i 'N;$!P;D' /etc/hosts.temp +cat /etc/hosts.temp > /etc/hosts + +log_stdin `cat /etc/hosts` +sleep 2 +# Start FE. +cd $SR_HOME/fe/bin/ + +log_stdin "Start FE" +./start_fe.sh --host_type FQDN --daemon + +# Start BE. +log_stdin "Start BE" +cd $SR_HOME/be/bin/ +./start_be.sh --daemon + +# Sleep until the cluster starts. +sleep 20; + +# Fetch fqdn with the command suggested by AWS official doc: https://docs.aws.amazon.com/managedservices/latest/userguide/find-FQDN.html +MYFQDN=`hostname --fqdn` +log_stdin "Register BE ${MYFQDN} to FE" +mysql -uroot -h${MYFQDN} -P 9030 -e "alter system add backend '${MYFQDN}:9050';" + +# Sleep until the BE register to FE. +sleep 5; + +log_stdin "init starrocks db begin..." +mysql -uroot -h${MYFQDN} -P 9030 <