From 7cf85a9d8cbab667dd6ba212d4439039511f834a Mon Sep 17 00:00:00 2001 From: aiceflower Date: Sat, 22 Jul 2023 23:12:14 +0800 Subject: [PATCH] [issue-4797] fix print error (#4798) * fix print error * fix print error --- linkis-dist/deploy-config/linkis-env.sh | 2 +- linkis-dist/package/sbin/clear-server.sh | 30 +++++++++++++----------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/linkis-dist/deploy-config/linkis-env.sh b/linkis-dist/deploy-config/linkis-env.sh index 2f04d5de18..2f160182c3 100644 --- a/linkis-dist/deploy-config/linkis-env.sh +++ b/linkis-dist/deploy-config/linkis-env.sh @@ -31,7 +31,7 @@ deployPwd= ### database type ### choose mysql or postgresql, default mysql dbType=mysql - +export dbType ##Linkis_SERVER_VERSION LINKIS_SERVER_VERSION=v1 diff --git a/linkis-dist/package/sbin/clear-server.sh b/linkis-dist/package/sbin/clear-server.sh index 321bbbbc17..f4b374902a 100644 --- a/linkis-dist/package/sbin/clear-server.sh +++ b/linkis-dist/package/sbin/clear-server.sh @@ -15,18 +15,20 @@ # source ${LINKIS_HOME}/conf/db.sh -echo 'DELETE FROM `linkis_cg_manager_label_value_relation` where label_value_key="alias"; -DELETE FROM `linkis_cg_manager_label_value_relation` where label_value_key="serviceName"; -DELETE FROM `linkis_cg_manager_label_value_relation` where label_value_key="instance"; -DELETE FROM `linkis_cg_manager_label` where label_key="engineInstance" or label_key="emInstance"; +if [ "$dbType" == "mysql" ]; then + echo 'DELETE FROM `linkis_cg_manager_label_value_relation` where label_value_key="alias"; + DELETE FROM `linkis_cg_manager_label_value_relation` where label_value_key="serviceName"; + DELETE FROM `linkis_cg_manager_label_value_relation` where label_value_key="instance"; + DELETE FROM `linkis_cg_manager_label` where label_key="engineInstance" or label_key="emInstance"; -DELETE FROM `linkis_cg_manager_label_service_instance`; -DELETE FROM `linkis_cg_manager_linkis_resources`; -DELETE FROM `linkis_cg_manager_service_instance_metrics`; -DELETE FROM `linkis_cg_manager_lock` ; -DELETE FROM `linkis_cg_manager_label_resource`; -DELETE FROM `linkis_cg_manager_service_instance`; -DELETE FROM `linkis_cg_manager_engine_em`; -' > /tmp/clearserver.command -mysql -h ${MYSQL_HOST} -P${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PASSWORD} ${MYSQL_DB} < /tmp/clearserver.command -rm -f /tmp/clearserver.command + DELETE FROM `linkis_cg_manager_label_service_instance`; + DELETE FROM `linkis_cg_manager_linkis_resources`; + DELETE FROM `linkis_cg_manager_service_instance_metrics`; + DELETE FROM `linkis_cg_manager_lock` ; + DELETE FROM `linkis_cg_manager_label_resource`; + DELETE FROM `linkis_cg_manager_service_instance`; + DELETE FROM `linkis_cg_manager_engine_em`; + ' > /tmp/clearserver.command + mysql -h ${MYSQL_HOST} -P${MYSQL_PORT} -u${MYSQL_USER} -p${MYSQL_PASSWORD} ${MYSQL_DB} < /tmp/clearserver.command + rm -f /tmp/clearserver.command +fi