diff options
Diffstat (limited to 'components/datalake-handler/des/src/assembly')
3 files changed, 3 insertions, 39 deletions
diff --git a/components/datalake-handler/des/src/assembly/init_db/scripts/db_init/15_db-adduser b/components/datalake-handler/des/src/assembly/init_db/scripts/db_init/15_db-adduser index 05b5c19b..92d2c730 100644 --- a/components/datalake-handler/des/src/assembly/init_db/scripts/db_init/15_db-adduser +++ b/components/datalake-handler/des/src/assembly/init_db/scripts/db_init/15_db-adduser @@ -24,7 +24,7 @@ fi echo "Creating datalake user" 1>/tmp/mariadb-datalake-user.log 2>&1 -mysql -uroot -p"$MYSQL_ROOT_PASSWORD" -p"$MYSQL_ROOT_PASSWORD" -h "$MYSQL_HOST" -P "$MYSQL_PORT" << 'EOF' || exit 1 +mysql -uroot -p"$MYSQL_ROOT_PASSWORD" -h "$MYSQL_HOST" -P "$MYSQL_PORT" << 'EOF' || exit 1 CREATE USER IF NOT EXISTS 'dl'; GRANT USAGE ON *.* TO 'dl'@'%' IDENTIFIED BY 'dl1234'; GRANT SELECT, INSERT, UPDATE, DELETE, EXECUTE, SHOW VIEW ON `datalake`.* TO 'dl'@'%'; diff --git a/components/datalake-handler/des/src/assembly/init_db/scripts/run.sh b/components/datalake-handler/des/src/assembly/init_db/scripts/run.sh deleted file mode 100644 index 20b4fc69..00000000 --- a/components/datalake-handler/des/src/assembly/init_db/scripts/run.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -# ============LICENSE_START========================================== -# =================================================================== -# Copyright (c) 2020 China Mobile.All rights reserved. -# -# Licensed 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. -#============LICENSE_END============================================ - - -echo "start init db ..." - -/bin/run-parts /app/db_init - -echo "finish init db" - - -curl -X PUT -H "contain-type:application/json" http://consul:8500/v1/kv/k8s-datalake -d "{\"mysql_host\": \"$MYSQL_HOST\", \"mysql_password\": \"$MYSQL_ROOT_PASSWORD\", \"mysql_port\": \"$MYSQL_PORT\", \"presto_host\": \"$PRESTO_HOST\"}" - diff --git a/components/datalake-handler/des/src/assembly/run.sh b/components/datalake-handler/des/src/assembly/run.sh index 42e6f134..decd97e0 100644 --- a/components/datalake-handler/des/src/assembly/run.sh +++ b/components/datalake-handler/des/src/assembly/run.sh @@ -15,6 +15,7 @@ # # SPDX-License-Identifier: Apache-2.0 # ============LICENSE_END===================================================== + #!/bin/sh echo "start init db ..." @@ -23,19 +24,10 @@ echo "start init db ..." echo "finish init db" -cmd=`find . -regex '\./des-[0-9]+\.[0-9]+\.[0-9]+[-SNAPSHOT]+\.jar'` -cmd1=`find . -regex '\./des-[0-9]+\.[0-9]+\.[0-9]+\.jar'` -cmd2=`find . -regex '\./des-[0-9]+\.[0-9]+\.[0-9]+[-execute]+\.jar'` -cmd3=`find . -regex '\./des-[0-9]+\.[0-9]+\.[0-9]+[-SNAPSHOT]+[-execute]+\.jar'` +cmd=`find . -name des*-execute.jar` if [ -n "$cmd" ]; then java -jar "$cmd" -elif [ -n "$cmd1" ]; then - java -jar "$cmd1" -elif [ -n "$cmd2" ]; then - java -jar "$cmd2" -elif [ -n "$cmd3" ]; then - java -jar "$cmd3" else echo "STRING is empty" sleep 10000 |