You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@linkis.apache.org by pe...@apache.org on 2022/02/26 01:46:56 UTC
[incubator-linkis] branch dev-1.1.0-datasource updated: optimize install.sh script (#1561)
This is an automated email from the ASF dual-hosted git repository.
peacewong pushed a commit to branch dev-1.1.0-datasource
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git
The following commit(s) were added to refs/heads/dev-1.1.0-datasource by this push:
new 30d09ba optimize install.sh script (#1561)
30d09ba is described below
commit 30d09ba6cc0c1382abfef6102d226b9d8d3f13f0
Author: Casion <ca...@gmail.com>
AuthorDate: Sat Feb 26 09:46:50 2022 +0800
optimize install.sh script (#1561)
---
.../assembly-combined/bin/linkis-cli | 15 +-
.../assembly-combined/conf/linkis.properties | 9 +-
.../assembly-combined/sbin/ext/linkis-common-start | 2 +
.../assembly-combined/sbin/ext/linkis-mg-eureka | 10 +-
.../assembly-combined/sbin/ext/linkis-mg-gateway | 3 +
assembly-combined-package/bin/checkEnv.sh | 60 +++++++
assembly-combined-package/bin/common.sh | 21 ++-
assembly-combined-package/bin/install.sh | 180 +++++++++------------
web/install.sh | 2 +-
9 files changed, 190 insertions(+), 112 deletions(-)
diff --git a/assembly-combined-package/assembly-combined/bin/linkis-cli b/assembly-combined-package/assembly-combined/bin/linkis-cli
index 4fdac8a..7f6d20c 100644
--- a/assembly-combined-package/assembly-combined/bin/linkis-cli
+++ b/assembly-combined-package/assembly-combined/bin/linkis-cli
@@ -18,6 +18,14 @@
export LANG=en_US.utf-8
LINKIS_CLIENT='org.apache.linkis.cli.application.LinkisClientApplication'
+
+## color
+RED='\033[0;31m'
+NC='\033[0m' # No Color
+GREEN='\033[0;32m'
+#used as: echo -e "Apache ${RED}Linkis ${NC} Test \n"
+
+
i=0
for arg in "$@"
do
@@ -55,7 +63,7 @@ locate_java_home() {
fi
if [ -z "$flag" ]; then
- echo -e "\033[0;31;40mNo JDK 8 found. linkis-client requires Java 1.8\033[0m" 1>&2
+ echo -e "${RED}No JDK 8 found. linkis-client requires Java 1.8${NC}" 1>&2
exit 1
fi
@@ -83,9 +91,10 @@ function call_linkis_client() {
cd ${current_dir}
LINKIS_DEPLOY_LIB_DIR='lib/linkis-computation-governance/linkis-client/linkis-cli/'
+ LINKIS_COMMON_LIB_DIR='lib/linkis-commons/public-module/'
LINKIS_DEPLOY_CONF_DIR='conf/linkis-cli'
LINKIS_DEPLOY_LOG_DIR='logs/linkis-cli'
- LINKIS_CLIENT_CLASSPATH=${workdir}/${LINKIS_DEPLOY_CONF_DIR}:${workdir}/${LINKIS_DEPLOY_LIB_DIR}*:${CLASSPATH}
+ LINKIS_CLIENT_CLASSPATH=${workdir}/${LINKIS_DEPLOY_CONF_DIR}:${workdir}/${LINKIS_DEPLOY_LIB_DIR}*:${workdir}/${LINKIS_COMMON_LIB_DIR}*:${CLASSPATH}
LINKIS_CLIENT_LOG_DIR=${LINKIS_CLIENT_LOG_DIR:-"${workdir}/${LINKIS_DEPLOY_LOG_DIR}"}
LINKIS_CLIENT_CONF_DIR=${LINKIS_CLIENT_CONF_DIR:-"${workdir}/${LINKIS_DEPLOY_CONF_DIR}"}
LINKIS_CLIENT_CONF_FILE=${LINKIS_CLIENT_CONF_FILE:-"linkis-cli.properties"}
@@ -97,6 +106,8 @@ function call_linkis_client() {
LINKIS_CLIENT_OPTS=${LINKIS_CLIENT_OPTS:-" ${DEBUG_OPTS} "}
+ echo "=====Java Start Command====="
+ echo "exec ${JAVA} ${LINKIS_CLIENT_HEAP_OPTS} ${LINKIS_CLIENT_GC_OPTS} ${LINKIS_CLIENT_OPTS} -classpath ${LINKIS_CLIENT_CLASSPATH} -Dconf.root=${LINKIS_CLIENT_CONF_DIR} -Dconf.file=${LINKIS_CLIENT_CONF_FILE} ${LINKIS_CLIENT_LOG_OPTS} ${LINKIS_CLIENT} '${input_args[@]}'"
exec ${JAVA} ${LINKIS_CLIENT_HEAP_OPTS} ${LINKIS_CLIENT_GC_OPTS} ${LINKIS_CLIENT_OPTS} -classpath ${LINKIS_CLIENT_CLASSPATH} -Dconf.root=${LINKIS_CLIENT_CONF_DIR} -Dconf.file=${LINKIS_CLIENT_CONF_FILE} ${LINKIS_CLIENT_LOG_OPTS} ${LINKIS_CLIENT} "${input_args[@]}"
}
diff --git a/assembly-combined-package/assembly-combined/conf/linkis.properties b/assembly-combined-package/assembly-combined/conf/linkis.properties
index 6098fc2..208a261 100644
--- a/assembly-combined-package/assembly-combined/conf/linkis.properties
+++ b/assembly-combined-package/assembly-combined/conf/linkis.properties
@@ -13,10 +13,11 @@
# limitations under the License.
#
-#
##enable wds.linkis.test.mode where use knife4j
#wds.linkis.test.mode=true
+
wds.linkis.server.version=v1
+
##spring conf
wds.linkis.gateway.url=http://127.0.0.1:9001
wds.linkis.eureka.defaultZone=http://127.0.0.1:20303/eureka/
@@ -26,10 +27,12 @@ wds.linkis.server.mybatis.datasource.username=
wds.linkis.server.mybatis.datasource.password=
# mysql
wds.linkis.mysql.is.encrypt=false
-#hadoopconfig
+
+#hadoop/hive/spark config
#hadoop.config.dir=/appcom/config/hadoop-config
#hive.config.dir=
#spark.config.dir
+
##file path
wds.linkis.filesystem.root.path=file:///tmp/linkis/
wds.linkis.filesystem.hdfs.root.path=hdfs:///tmp/linkis/
@@ -37,10 +40,12 @@ wds.linkis.filesystem.hdfs.root.path=hdfs:///tmp/linkis/
wds.linkis.bml.is.hdfs=true
wds.linkis.bml.hdfs.prefix=/apps-data
#wds.linkis.bml.local.prefix=/data/dss/bml
+
##engine Version
#wds.linkis.spark.engine.version=
#wds.linkis.hive.engine.version=
#wds.linkis.python.engine.version=
+
#LinkisHome
wds.linkis.home=/appcom/Install/LinkisInstall
#Linkis governance station administrators
diff --git a/assembly-combined-package/assembly-combined/sbin/ext/linkis-common-start b/assembly-combined-package/assembly-combined/sbin/ext/linkis-common-start
index 67e8f0b..d2a15e2 100644
--- a/assembly-combined-package/assembly-combined/sbin/ext/linkis-common-start
+++ b/assembly-combined-package/assembly-combined/sbin/ext/linkis-common-start
@@ -72,6 +72,8 @@ fi
## set class path
export SERVER_CLASS_PATH=$SERVER_CONF_PATH:$LINKIS_COMMONS_LIB/*:$SERVER_LIB/*
+echo "=====Java Start Command====="
+echo "nohup java $SERVER_JAVA_OPTS -cp $SERVER_CLASS_PATH $SERVER_CLASS $SPRING_ARGS 2>&1 > $LINKIS_LOG_DIR/${SERVER_NAME}.out &"
nohup java $SERVER_JAVA_OPTS -cp $SERVER_CLASS_PATH $SERVER_CLASS $SPRING_ARGS 2>&1 > $LINKIS_LOG_DIR/${SERVER_NAME}.out &
pid=$!
diff --git a/assembly-combined-package/assembly-combined/sbin/ext/linkis-mg-eureka b/assembly-combined-package/assembly-combined/sbin/ext/linkis-mg-eureka
index 633756a..6dced4a 100644
--- a/assembly-combined-package/assembly-combined/sbin/ext/linkis-mg-eureka
+++ b/assembly-combined-package/assembly-combined/sbin/ext/linkis-mg-eureka
@@ -55,6 +55,12 @@ export SERVER_CLASS=org.apache.linkis.eureka.SpringCloudEurekaApplication
## conf dir
export SERVER_CONF_PATH=$LINKIS_CONF_DIR
+## commons lib
+export LINKIS_COMMONS_LIB=$LINKIS_HOME/$LINKIS_PUBLIC_MODULE
+if [ ! -r "$LINKIS_COMMONS_LIB" ] ; then
+ echo "linkis commons lib not exists $LINKIS_COMMONS_LIB"
+ exit 1
+fi
## server lib
export SERVER_LIB=$LINKIS_HOME/lib/$SERVER_SUFFIX
@@ -64,7 +70,7 @@ if [ ! -r "$SERVER_LIB" ] ; then
fi
## set class path
-export SERVER_CLASS_PATH=$SERVER_CONF_PATH:$SERVER_LIB/*
+export SERVER_CLASS_PATH=$SERVER_CONF_PATH:$LINKIS_COMMONS_LIB/*:$SERVER_LIB/*
SERVER_IP="`hostname --fqdn`"
@@ -84,6 +90,8 @@ else
fi
SPRING_ARGS="$SPRING_ARGS --spring.profiles.active=eureka"
+echo "=====Java Start Command====="
+echo "nohup java $SERVER_JAVA_OPTS -cp $SERVER_CLASS_PATH $SERVER_CLASS $SPRING_ARGS 2>&1 > $LINKIS_LOG_DIR/${SERVER_NAME}.out &"
nohup java $SERVER_JAVA_OPTS -cp $SERVER_CLASS_PATH $SERVER_CLASS $SPRING_ARGS 2>&1 > $LINKIS_LOG_DIR/${SERVER_NAME}.out &
pid=$!
diff --git a/assembly-combined-package/assembly-combined/sbin/ext/linkis-mg-gateway b/assembly-combined-package/assembly-combined/sbin/ext/linkis-mg-gateway
index fdbe11e..d65b935 100644
--- a/assembly-combined-package/assembly-combined/sbin/ext/linkis-mg-gateway
+++ b/assembly-combined-package/assembly-combined/sbin/ext/linkis-mg-gateway
@@ -75,6 +75,9 @@ fi
## set class path
export SERVER_CLASS_PATH=$SERVER_CONF_PATH:$SERVER_LIB/*
+echo "=====Java Start Command====="
+echo "nohup java $SERVER_JAVA_OPTS -cp $SERVER_CLASS_PATH $SERVER_CLASS $SPRING_ARGS 2>&1 > $LINKIS_LOG_DIR/${SERVER_NAME}.out &"
+
nohup java $SERVER_JAVA_OPTS -cp $SERVER_CLASS_PATH $SERVER_CLASS $SPRING_ARGS 2>&1 > $LINKIS_LOG_DIR/${SERVER_NAME}.out &
pid=$!
diff --git a/assembly-combined-package/bin/checkEnv.sh b/assembly-combined-package/bin/checkEnv.sh
index 4fadcf1..83ffdb4 100644
--- a/assembly-combined-package/bin/checkEnv.sh
+++ b/assembly-combined-package/bin/checkEnv.sh
@@ -14,6 +14,10 @@
# limitations under the License.
#
+shellDir=`dirname $0`
+workDir=`cd ${shellDir}/..;pwd`
+source ${workDir}/bin/common.sh
+
say() {
printf 'check command fail \n %s\n' "$1"
}
@@ -23,6 +27,49 @@ err() {
exit 1
}
+function checkPythonAndJava(){
+ python --version > /dev/null 2>&1
+ isSuccess "execute cmd: python --version"
+ java -version > /dev/null 2>&1
+ isSuccess "execute cmd: java --version"
+}
+
+function checkHadoopAndHive(){
+ hadoopVersion="`hdfs version`"
+ defaultHadoopVersion="2.7"
+ checkversion "$hadoopVersion" $defaultHadoopVersion hadoop
+ checkversion "$(whereis hive)" "2.3" hive
+}
+
+function checkversion(){
+versionStr=$1
+defaultVersion=$2
+module=$3
+
+result=$(echo $versionStr | grep "$defaultVersion")
+if [ -n "$result" ]; then
+ echo -e "Your [$module] version may match default support version: $defaultVersion\n"
+else
+ echo "WARN: Your [$module] version is not match default support version: $defaultVersion, there may be compatibility issues:"
+ echo " 1: Continue installation, there may be compatibility issues"
+ echo " 2: Exit installation"
+ echo -e " other: exit\n"
+
+ read -p "[Please input your choice]:" idx
+ if [[ '1' != "$idx" ]];then
+ echo -e "You chose Exit installation\n"
+ exit 1
+ fi
+ echo ""
+fi
+}
+
+function checkSpark(){
+ spark-submit --version > /dev/null 2>&1
+ isSuccess "execute cmd: spark-submit --version "
+}
+
+
check_cmd() {
command -v "$1" > /dev/null 2>&1
}
@@ -32,11 +79,24 @@ need_cmd() {
err "need '$1' (your linux command not found)"
fi
}
+
+
echo "<-----start to check used cmd---->"
+echo "check yum"
need_cmd yum
+echo "check java"
need_cmd java
+echo "check mysql"
need_cmd mysql
+echo "check telnet"
need_cmd telnet
+echo "check tar"
need_cmd tar
+echo "check sed"
need_cmd sed
echo "<-----end to check used cmd---->"
+
+checkSpark
+checkPythonAndJava
+checkHadoopAndHive
+
diff --git a/assembly-combined-package/bin/common.sh b/assembly-combined-package/bin/common.sh
index 6d79a25..5344fda 100644
--- a/assembly-combined-package/bin/common.sh
+++ b/assembly-combined-package/bin/common.sh
@@ -21,6 +21,12 @@ export local_host="`hostname --fqdn`"
ipaddr=$(ip addr | awk '/^[0-9]+: / {}; /inet.*global/ {print gensub(/(.*)\/(.*)/, "\\1", "g", $2)}')
+## color
+RED='\033[0;31m'
+NC='\033[0m' # No Color
+GREEN='\033[0;32m'
+#used as: echo -e "Apache ${RED}Linkis ${NC} Test \n"
+
function isLocal(){
if [ "$1" == "127.0.0.1" ];then
return 0
@@ -65,9 +71,20 @@ function copyFile(){
function isSuccess(){
if [ $? -ne 0 ]; then
- echo "Failed to " + $1
+ echo -e "${RED}Failed${NC} to $1"
+ echo ""
exit 1
else
- echo "Succeed to" + $1
+ echo -e "${GREEN}Succeed${NC} to $1"
+ echo ""
+fi
+}
+
+function isSuccessWithoutExit(){
+if [ $? -ne 0 ]; then
+ echo -e "WARN failed to $1 , but installation will continue,some function may not work properly"
+else
+ echo -e "${GREEN}Succeed${NC} to $1"
+ echo ""
fi
}
\ No newline at end of file
diff --git a/assembly-combined-package/bin/install.sh b/assembly-combined-package/bin/install.sh
index 4143dfa..d10f3d6 100644
--- a/assembly-combined-package/bin/install.sh
+++ b/assembly-combined-package/bin/install.sh
@@ -46,174 +46,121 @@ fi
## import common.sh
source ${workDir}/bin/common.sh
-
-
-function checkPythonAndJava(){
- python --version
- isSuccess "execute python --version"
- java -version
- isSuccess "execute java --version"
-}
-
-function checkHadoopAndHive(){
- hadoopVersion="`hdfs version`"
- defaultHadoopVersion="2.7"
- checkversion "$hadoopVersion" $defaultHadoopVersion hadoop
- checkversion "$(whereis hive)" "2.3" hive
-}
-
-function checkversion(){
-versionStr=$1
-defaultVersion=$2
-module=$3
-
-result=$(echo $versionStr | grep "$defaultVersion")
-if [ -n "$result" ]; then
- echo "$module version match"
-else
- echo "WARN: Your $module version is not $defaultVersion, there may be compatibility issues:"
- echo " 1: Continue installation, there may be compatibility issues"
- echo " 2: Exit installation"
- echo ""
- read -p "Please input the choice:" idx
- if [[ '2' = "$idx" ]];then
- echo "You chose Exit installation"
- exit 1
- fi
-fi
-}
-
-function checkSpark(){
- spark-submit --version
- isSuccess "execute spark-submit --version"
-}
-
-say() {
- printf 'check command fail \n %s\n' "$1"
-}
-
-err() {
- say "$1" >&2
- exit 1
-}
-
-check_cmd() {
- command -v "$1" > /dev/null 2>&1
-}
-
-need_cmd() {
- if ! check_cmd "$1"; then
- err "need '$1' (command not found)"
- fi
-}
-
-
-
-sh ${workDir}/bin/checkEnv.sh
-isSuccess "check env"
-
##load config
-echo "step1:load config "
+echo "======= Step 1: Load deploy-config/* =========="
export LINKIS_CONFIG_PATH=${LINKIS_CONFIG_PATH:-"${workDir}/deploy-config/linkis-env.sh"}
export LINKIS_DB_CONFIG_PATH=${LINKIS_DB_CONFIG_PATH:-"${workDir}/deploy-config/db.sh"}
+
source ${LINKIS_CONFIG_PATH}
source ${LINKIS_DB_CONFIG_PATH}
-
isSuccess "load config"
-##env check
-echo "Do you want to clear Linkis table information in the database?"
-echo " 1: Do not execute table-building statements"
-echo " 2: Dangerous! Clear all data and rebuild the tables"
-echo " other: exit"
-echo ""
-MYSQL_INSTALL_MODE=1
+echo "======= Step 2: Check env =========="
+## check env
+sh ${workDir}/bin/checkEnv.sh
+isSuccess "check env"
-read -p "Please input the choice:" idx
-if [[ '2' = "$idx" ]];then
- MYSQL_INSTALL_MODE=2
- echo "You chose Rebuild the table"
-elif [[ '1' = "$idx" ]];then
- MYSQL_INSTALL_MODE=1
- echo "You chose not execute table-building statements"
-else
- echo "no choice,exit!"
- exit 1
-fi
+until mysql -h$MYSQL_HOST -P$MYSQL_PORT -u$MYSQL_USER -p$MYSQL_PASSWORD -e ";" ; do
+ echo "try to connect to linkis mysql $MYSQL_HOST:$MYSQL_PORT/$MYSQL_DB failed, please check db configuration in:$LINKIS_DB_CONFIG_PATH"
+ exit 1
+done
+
+echo "======= Step 3: Create necessary directory =========="
-echo "create hdfs directory and local directory"
+echo "[WORKSPACE_USER_ROOT_PATH] try to create directory"
if [ "$WORKSPACE_USER_ROOT_PATH" != "" ]
then
localRootDir=$WORKSPACE_USER_ROOT_PATH
if [[ $WORKSPACE_USER_ROOT_PATH == file://* ]];then
localRootDir=${WORKSPACE_USER_ROOT_PATH#file://}
+ echo "[WORKSPACE_USER_ROOT_PATH] try to create local dir,cmd is: mkdir -p $localRootDir/$deployUser"
mkdir -p $localRootDir/$deployUser
sudo chmod -R 775 $localRootDir/$deployUser
elif [[ $WORKSPACE_USER_ROOT_PATH == hdfs://* ]];then
localRootDir=${WORKSPACE_USER_ROOT_PATH#hdfs://}
+ echo "[WORKSPACE_USER_ROOT_PATH] try to create hdfs dir,cmd is: hdfs dfs -mkdir -p $localRootDir/$deployUser"
hdfs dfs -mkdir -p $localRootDir/$deployUser
hdfs dfs -chmod -R 775 $localRootDir/$deployUser
else
- echo "does not support $WORKSPACE_USER_ROOT_PATH filesystem types"
+ echo "[WORKSPACE_USER_ROOT_PATH] does not support $WORKSPACE_USER_ROOT_PATH filesystem types"
fi
+ isSuccess "create WORKSPACE_USER_ROOT_PATH: $WORKSPACE_USER_ROOT_PATH directory"
fi
-isSuccess "create $WORKSPACE_USER_ROOT_PATH directory"
+
######################## init hdfs and db ################################
+echo "[HDFS_USER_ROOT_PATH] try to create directory"
if [ "$HDFS_USER_ROOT_PATH" != "" ]
then
localRootDir=$HDFS_USER_ROOT_PATH
if [[ $HDFS_USER_ROOT_PATH == file://* ]];then
localRootDir=${HDFS_USER_ROOT_PATH#file://}
+ echo "[HDFS_USER_ROOT_PATH] try to create local dir,cmd is: mkdir -p $localRootDir/$deployUser"
mkdir -p $localRootDir/$deployUser
sudo chmod -R 775 $localRootDir/$deployUser
elif [[ $HDFS_USER_ROOT_PATH == hdfs://* ]];then
localRootDir=${HDFS_USER_ROOT_PATH#hdfs://}
+ echo "[HDFS_USER_ROOT_PATH] try to create hdfs dir,cmd is: hdfs dfs -mkdir -p $localRootDir/$deployUser"
hdfs dfs -mkdir -p $localRootDir/$deployUser
else
- echo "does not support $HDFS_USER_ROOT_PATH filesystem types"
+ echo "[HDFS_USER_ROOT_PATH] does not support $HDFS_USER_ROOT_PATH filesystem types"
fi
+
+ isSuccess "create HDFS_USER_ROOT_PATH: $HDFS_USER_ROOT_PATH directory"
+
fi
- isSuccess "create $HDFS_USER_ROOT_PATH directory"
+
+echo "[RESULT_SET_ROOT_PATH] try to create directory"
if [ "$RESULT_SET_ROOT_PATH" != "" ]
then
localRootDir=$RESULT_SET_ROOT_PATH
if [[ $RESULT_SET_ROOT_PATH == file://* ]];then
localRootDir=${RESULT_SET_ROOT_PATH#file://}
- mkdir -p $localRootDir/$deployUser
- sudo chmod -R 775 $localRootDir/$deployUser
+ echo "[RESULT_SET_ROOT_PATH] try to create local dir,cmd is: mkdir -p $localRootDir/$deployUser"
+ mkdir -p $localRootDir/$deployUser
+ sudo chmod -R 775 $localRootDir/$deployUser
elif [[ $RESULT_SET_ROOT_PATH == hdfs://* ]];then
localRootDir=${RESULT_SET_ROOT_PATH#hdfs://}
- hdfs dfs -mkdir -p $localRootDir
- hdfs dfs -chmod 775 $localRootDir
+ echo "[RESULT_SET_ROOT_PATH] try to create hdfs dir,cmd is: hdfs dfs -mkdir -p $localRootDir/$deployUser"
+ hdfs dfs -mkdir -p $localRootDir
+ hdfs dfs -chmod 775 $localRootDir
else
- echo "does not support $RESULT_SET_ROOT_PATH filesystem types"
+ echo "[RESULT_SET_ROOT_PATH] does not support $RESULT_SET_ROOT_PATH filesystem types"
fi
+
+ isSuccess "create RESULT_SET_ROOT_PATH: $RESULT_SET_ROOT_PATH directory"
+
fi
- isSuccess "create $RESULT_SET_ROOT_PATH directory"
+
if [ "$LINKIS_HOME" = "" ]
then
export LINKIS_HOME=${workDir}/LinkisInstall
fi
+
if [ -d $LINKIS_HOME ] && [ "$LINKIS_HOME" != "$workDir" ];then
- rm -r $LINKIS_HOME-bak
+ echo "LINKIS_HOME: $LINKIS_HOME is alread exists and will be backed up"
+ if [ -d $LINKIS_HOME-bak ];then
+ rm -r $LINKIS_HOME-bak
+ fi
+
echo "mv $LINKIS_HOME $LINKIS_HOME-bak"
mv $LINKIS_HOME $LINKIS_HOME-bak
+ isSuccess "back up old LINKIS_HOME:$LINKIS_HOME to $LINKIS_HOME-bak"
fi
-echo "create dir LINKIS_HOME: $LINKIS_HOME"
+echo "try to create dir LINKIS_HOME: $LINKIS_HOME"
sudo mkdir -p $LINKIS_HOME;sudo chown -R $deployUser:$deployUser $LINKIS_HOME
-isSuccess "Create the dir of $LINKIS_HOME"
+isSuccess "create the dir of LINKIS_HOME:$LINKIS_HOME"
LINKIS_PACKAGE=${workDir}/linkis-package
if ! test -d ${LINKIS_PACKAGE}; then
- echo "**********Error: please put ${LINKIS_PACKAGE} in $workDir! "
+ echo "**********${RED}Error${NC}: please put ${LINKIS_PACKAGE} in $workDir! "
exit 1
else
echo "Start to cp ${LINKIS_PACKAGE} to $LINKIS_HOME."
@@ -223,6 +170,9 @@ fi
cp ${LINKIS_CONFIG_PATH} $LINKIS_HOME/conf
+
+
+echo "======= Step 4: Create linkis table =========="
## sql init
if [ "$YARN_RESTFUL_URL" != "" ]
then
@@ -260,6 +210,26 @@ then
sed -i ${txt} "s#\#wds.linkis.python.engine.version.*#wds.linkis.python.engine.version=$PYTHON_VERSION#g" $common_conf
fi
+echo "Linkis mysql DB will use this config: $MYSQL_HOST:$MYSQL_PORT/$MYSQL_DB"
+echo "Do you want to clear Linkis table information in the database?"
+echo " 1: Do not execute table-building statements"
+echo -e "${RED} 2: Dangerous! Clear all data and rebuild the tables${NC}"
+echo -e " other: exit\n"
+
+MYSQL_INSTALL_MODE=1
+
+read -p "[Please input your choice]:" idx
+if [[ '2' = "$idx" ]];then
+ MYSQL_INSTALL_MODE=2
+ echo "You chose Rebuild the table"
+elif [[ '1' = "$idx" ]];then
+ MYSQL_INSTALL_MODE=1
+ echo "You chose not execute table-building statements"
+else
+ echo "no choice,exit!"
+ exit 1
+fi
+
##Label set end
#Deal special symbol '#'
@@ -279,7 +249,8 @@ fi
#Deal common config
-echo "Update config..."
+echo ""
+echo "======= Step 5: Update config =========="
if test -z "$EUREKA_INSTALL_IP"
then
@@ -413,6 +384,7 @@ then
sed -i ${txt} "s#spring.server.port.*#spring.server.port=$CS_PORT#g" $cs_conf
fi
+echo -e "\n"
-echo "Congratulations! You have installed Linkis $LINKIS_VERSION successfully, please use sh $LINKIS_HOME/sbin/linkis-start-all.sh to start it!"
-echo "Your default account/password is $deployUser/$defaultPwd"
+echo -e "${GREEN}Congratulations!${NC} You have installed Linkis $LINKIS_VERSION successfully, please use sh $LINKIS_HOME/sbin/linkis-start-all.sh to start it!"
+echo -e "Your default account/password is ${GREEN}[$deployUser/$defaultPwd]${NC}, you can find in $LINKIS_HOME/conf/linkis-mg-gateway.properties"
diff --git a/web/install.sh b/web/install.sh
index 1dc5619..59ba6dc 100644
--- a/web/install.sh
+++ b/web/install.sh
@@ -71,7 +71,7 @@ echo ""
# 创建文件并配置nginx
linkisConf(){
- s_host='$host'
+ s_host='$host'
s_remote_addr='$remote_addr'
s_proxy_add_x_forwarded_for='$proxy_add_x_forwarded_for'
s_http_upgrade='$http_upgrade'
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org