This is an automated email from the ASF dual-hosted git repository.
peacewong pushed a commit to branch dev-1.3.2
in repository https://gitbox.apache.org/repos/asf/linkis.git
The following commit(s) were added to refs/heads/dev-1.3.2 by this push:
new 89d0ed524 Linkis manager data was cleared,when running
linkis-start-all.sh script (#4205)
89d0ed524 is described below
commit 89d0ed52415b27a38ab9b81c95f41ed5ade5911b
Author: LuckilyTimer <[email protected]>
AuthorDate: Mon Feb 13 21:51:20 2023 +0800
Linkis manager data was cleared,when running linkis-start-all.sh script
(#4205)
* copy db.sh to conf
---
linkis-dist/bin/install.sh | 1 +
linkis-dist/package/sbin/clear-server.sh | 32 ++++++++++++++++++++++++++++
linkis-dist/package/sbin/linkis-start-all.sh | 4 +++-
3 files changed, 36 insertions(+), 1 deletion(-)
diff --git a/linkis-dist/bin/install.sh b/linkis-dist/bin/install.sh
index c52ec43c4..038d27846 100644
--- a/linkis-dist/bin/install.sh
+++ b/linkis-dist/bin/install.sh
@@ -102,6 +102,7 @@ else
fi
cp ${LINKIS_CONFIG_PATH} $LINKIS_HOME/conf
+cp ${LINKIS_DB_CONFIG_PATH} $LINKIS_HOME/conf
common_conf=$LINKIS_HOME/conf/linkis.properties
diff --git a/linkis-dist/package/sbin/clear-server.sh
b/linkis-dist/package/sbin/clear-server.sh
new file mode 100644
index 000000000..321bbbbc1
--- /dev/null
+++ b/linkis-dist/package/sbin/clear-server.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+#
+# 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.
+#
+
+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";
+
+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
diff --git a/linkis-dist/package/sbin/linkis-start-all.sh
b/linkis-dist/package/sbin/linkis-start-all.sh
index 38f9afdcb..c9bd38061 100644
--- a/linkis-dist/package/sbin/linkis-start-all.sh
+++ b/linkis-dist/package/sbin/linkis-start-all.sh
@@ -60,13 +60,15 @@ echo "<-------------------------------->"
sleep 3
}
+echo "<-------------------------------->"
+echo "Linkis manager data is being cleared"
+sh $LINKIS_HOME/sbin/clear-server.sh
#linkis-mg-eureka
export SERVER_NAME="mg-eureka"
SERVER_IP=$EUREKA_INSTALL_IP
startApp
-
#linkis-mg-gateway
SERVER_NAME="mg-gateway"
SERVER_IP=$GATEWAY_INSTALL_IP
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]