This is an automated email from the ASF dual-hosted git repository.
casion pushed a commit to branch dev-1.3.2
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git
The following commit(s) were added to refs/heads/dev-1.3.2 by this push:
new 38a4a696c [ISSUE-3887]linkis-daemon.sh can dynamically specify the
debug port and dynamically specify the jvm memory (#3891)
38a4a696c is described below
commit 38a4a696c04c0ec40d192658a63d99f92c0e85f8
Author: binbincheng <[email protected]>
AuthorDate: Wed Dec 14 21:00:54 2022 +0800
[ISSUE-3887]linkis-daemon.sh can dynamically specify the debug port and
dynamically specify the jvm memory (#3891)
---
linkis-dist/deploy-config/linkis-env.sh | 6 +++
.../package/sbin/ext/linkis-cg-engineconnmanager | 11 ++++-
linkis-dist/package/sbin/ext/linkis-cg-entrance | 12 ++++-
.../package/sbin/ext/linkis-cg-linkismanager | 12 ++++-
linkis-dist/package/sbin/ext/linkis-common-start | 10 +++-
linkis-dist/package/sbin/ext/linkis-mg-eureka | 13 +++--
linkis-dist/package/sbin/ext/linkis-mg-gateway | 11 +++--
.../package/sbin/ext/linkis-ps-publicservice | 12 ++++-
linkis-dist/package/sbin/linkis-daemon.sh | 56 +++++++++++++++++++++-
9 files changed, 129 insertions(+), 14 deletions(-)
diff --git a/linkis-dist/deploy-config/linkis-env.sh
b/linkis-dist/deploy-config/linkis-env.sh
index 85d954fd9..91b419b78 100644
--- a/linkis-dist/deploy-config/linkis-env.sh
+++ b/linkis-dist/deploy-config/linkis-env.sh
@@ -114,26 +114,32 @@ HADOOP_VERSION=2.7.2
#EUREKA_INSTALL_IP=127.0.0.1
EUREKA_PORT=20303
export EUREKA_PREFER_IP=false
+#EUREKA_HEAP_SIZE="512M"
##linkis-mg-gateway
#GATEWAY_INSTALL_IP=127.0.0.1
GATEWAY_PORT=9001
+#GATEWAY_HEAP_SIZE="512M"
##linkis-cg-linkismanager
#MANAGER_INSTALL_IP=127.0.0.1
MANAGER_PORT=9101
+#MANAGER_HEAP_SIZE="512M"
##linkis-cg-engineconnmanager
#ENGINECONNMANAGER_INSTALL_IP=127.0.0.1
ENGINECONNMANAGER_PORT=9102
+#ENGINECONNMANAGER_HEAP_SIZE="512M"
##linkis-cg-entrance
#ENTRANCE_INSTALL_IP=127.0.0.1
ENTRANCE_PORT=9104
+#ENTRANCE_HEAP_SIZE="512M"
##linkis-ps-publicservice
#PUBLICSERVICE_INSTALL_IP=127.0.0.1
PUBLICSERVICE_PORT=9105
+#PUBLICSERVICE_HEAP_SIZE="512M"
########################################################################################
diff --git a/linkis-dist/package/sbin/ext/linkis-cg-engineconnmanager
b/linkis-dist/package/sbin/ext/linkis-cg-engineconnmanager
index 403d76c35..f0d4a8757 100644
--- a/linkis-dist/package/sbin/ext/linkis-cg-engineconnmanager
+++ b/linkis-dist/package/sbin/ext/linkis-cg-engineconnmanager
@@ -16,11 +16,20 @@
# description: ecm start cmd
#
# Modified for Linkis 1.0.0
-
+source $LINKIS_CONF_DIR/linkis-env.sh
export
SERVER_SUFFIX="linkis-computation-governance/linkis-cg-engineconnmanager"
export SERVER_CLASS=org.apache.linkis.ecm.server.LinkisECMApplication
+if test -z "$ENGINECONNMANAGER_HEAP_SIZE"
+ then
+ if test -z "$SERVER_HEAP_SIZE"
+ then
+ export SERVER_HEAP_SIZE="512M"
+ fi
+else
+ export SERVER_HEAP_SIZE=$ENGINECONNMANAGER_HEAP_SIZE
+fi
#export DEBUG_PORT=
export COMMON_START_BIN=$LINKIS_HOME/sbin/ext/linkis-common-start
diff --git a/linkis-dist/package/sbin/ext/linkis-cg-entrance
b/linkis-dist/package/sbin/ext/linkis-cg-entrance
index 3dd96ded6..0db516244 100644
--- a/linkis-dist/package/sbin/ext/linkis-cg-entrance
+++ b/linkis-dist/package/sbin/ext/linkis-cg-entrance
@@ -17,11 +17,21 @@
#
# Modified for Linkis 1.0.0
-
+source $LINKIS_CONF_DIR/linkis-env.sh
export SERVER_SUFFIX="linkis-computation-governance/linkis-cg-entrance"
export SERVER_CLASS=org.apache.linkis.entrance.LinkisEntranceApplication
+if test -z "$ENTRANCE_HEAP_SIZE"
+ then
+ if test -z "$SERVER_HEAP_SIZE"
+ then
+ export SERVER_HEAP_SIZE="512M"
+ fi
+else
+ export SERVER_HEAP_SIZE=$ENTRANCE_HEAP_SIZE
+fi
+
#export DEBUG_PORT=
export COMMON_START_BIN=$LINKIS_HOME/sbin/ext/linkis-common-start
diff --git a/linkis-dist/package/sbin/ext/linkis-cg-linkismanager
b/linkis-dist/package/sbin/ext/linkis-cg-linkismanager
index 40a9b17c0..7a3849534 100644
--- a/linkis-dist/package/sbin/ext/linkis-cg-linkismanager
+++ b/linkis-dist/package/sbin/ext/linkis-cg-linkismanager
@@ -17,13 +17,23 @@
#
# Modified for Linkis 1.0.0
-
+source $LINKIS_CONF_DIR/linkis-env.sh
export SERVER_SUFFIX="linkis-computation-governance/linkis-cg-linkismanager"
export SERVER_HEAP_SIZE="1G"
export SERVER_CLASS=org.apache.linkis.manager.am.LinkisManagerApplication
+if test -z "$MANAGER_HEAP_SIZE"
+ then
+ if test -z "$SERVER_HEAP_SIZE"
+ then
+ export SERVER_HEAP_SIZE="512M"
+ fi
+else
+ export SERVER_HEAP_SIZE=$MANAGER_HEAP_SIZE
+fi
+
#export DEBUG_PORT=
export COMMON_START_BIN=$LINKIS_HOME/sbin/ext/linkis-common-start
diff --git a/linkis-dist/package/sbin/ext/linkis-common-start
b/linkis-dist/package/sbin/ext/linkis-common-start
index c312e58cd..2f2ec8906 100644
--- a/linkis-dist/package/sbin/ext/linkis-common-start
+++ b/linkis-dist/package/sbin/ext/linkis-common-start
@@ -27,9 +27,15 @@ if [ ! -w "$LINKIS_LOG_DIR" ] ; then
mkdir -p "$LINKIS_LOG_DIR"
fi
-if test -z "$SERVER_HEAP_SIZE"
+#export DYNAMIC_JVM=
+if test -z "$DYNAMIC_JVM"
then
- export SERVER_HEAP_SIZE="512M"
+ if test -z "$SERVER_HEAP_SIZE"
+ then
+ export SERVER_HEAP_SIZE="512M"
+ fi
+else
+ export SERVER_HEAP_SIZE="${DYNAMIC_JVM}"
fi
if [ "$DEBUG_PORT" ];
diff --git a/linkis-dist/package/sbin/ext/linkis-mg-eureka
b/linkis-dist/package/sbin/ext/linkis-mg-eureka
index 6beb502d5..9b96da1d6 100644
--- a/linkis-dist/package/sbin/ext/linkis-mg-eureka
+++ b/linkis-dist/package/sbin/ext/linkis-mg-eureka
@@ -31,11 +31,18 @@ if [ ! -w "$LINKIS_LOG_DIR" ] ; then
mkdir -p "$LINKIS_LOG_DIR"
fi
-if test -z "$SERVER_HEAP_SIZE"
-then
- export SERVER_HEAP_SIZE="512M"
+
+if test -z "$EUREKA_HEAP_SIZE"
+ then
+ if test -z "$SERVER_HEAP_SIZE"
+ then
+ export SERVER_HEAP_SIZE="512M"
+ fi
+else
+ export SERVER_HEAP_SIZE=$EUREKA_HEAP_SIZE
fi
+
if [ "$DEBUG_PORT" ];
then
export
DEBUG_CMD="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=$DEBUG_PORT"
diff --git a/linkis-dist/package/sbin/ext/linkis-mg-gateway
b/linkis-dist/package/sbin/ext/linkis-mg-gateway
index d918e9aed..34df839ba 100644
--- a/linkis-dist/package/sbin/ext/linkis-mg-gateway
+++ b/linkis-dist/package/sbin/ext/linkis-mg-gateway
@@ -31,9 +31,14 @@ if [ ! -w "$LINKIS_LOG_DIR" ] ; then
mkdir -p "$LINKIS_LOG_DIR"
fi
-if test -z "$SERVER_HEAP_SIZE"
-then
- export SERVER_HEAP_SIZE="512M"
+if test -z "$GATEWAY_HEAP_SIZE"
+ then
+ if test -z "$SERVER_HEAP_SIZE"
+ then
+ export SERVER_HEAP_SIZE="512M"
+ fi
+else
+ export SERVER_HEAP_SIZE=$GATEWAY_HEAP_SIZE
fi
if [ "$DEBUG_PORT" ];
diff --git a/linkis-dist/package/sbin/ext/linkis-ps-publicservice
b/linkis-dist/package/sbin/ext/linkis-ps-publicservice
index 6ab965226..71622c1f2 100644
--- a/linkis-dist/package/sbin/ext/linkis-ps-publicservice
+++ b/linkis-dist/package/sbin/ext/linkis-ps-publicservice
@@ -17,10 +17,20 @@
#
# Modified for Linkis 1.0.0
-
+source $LINKIS_CONF_DIR/linkis-env.sh
export SERVER_SUFFIX="linkis-public-enhancements/linkis-ps-publicservice"
+if test -z "$PUBLICSERVICE_HEAP_SIZE"
+ then
+ if test -z "$SERVER_HEAP_SIZE"
+ then
+ export SERVER_HEAP_SIZE="512M"
+ fi
+else
+ export SERVER_HEAP_SIZE=$PUBLICSERVICE_HEAP_SIZE
+fi
+
#export DEBUG_PORT=
export SERVER_CLASS=org.apache.linkis.filesystem.LinkisPublicServiceApp
diff --git a/linkis-dist/package/sbin/linkis-daemon.sh
b/linkis-dist/package/sbin/linkis-daemon.sh
index b8569cdc7..812b72e5e 100755
--- a/linkis-dist/package/sbin/linkis-daemon.sh
+++ b/linkis-dist/package/sbin/linkis-daemon.sh
@@ -26,16 +26,63 @@ INSTALL_HOME=`pwd`
function print_usage(){
- echo "Usage: linkis-daemon [start | stop | restart | status] [serverName]"
+ echo "Usage: linkis-daemon [start | stop | restart | status] [serverName]
[debug-port] [jvm-num] "
echo " serverName The service name of the operation"
+ echo "debug-port Specify the service to open the debug port. Not required"
+ echo "jvm-num Specifies the JVM service memory. Not necessary"
echo "Most commands print help when invoked w/o parameters."
}
-if [ $# != 2 ]; then
+if [ $# -gt 4 ]; then
print_usage
exit 2
fi
+#set init debug_port and jvm-num
+export debug_port=""
+export jvm_num=""
+
+if [ $# -eq 4 ]; then
+ if [[ ${3} == *"debug"* ]]; then
+ export debug_port=${3#*-}
+ export jvm_num=${4#*-}
+ else
+ export jvm_num=${3#*-}
+ export debug_port=${4#*-}
+ fi
+fi
+
+if [ $# -eq 3 ]; then
+ if [[ ${3} == *"debug"* ]]; then
+ export debug_port=${3#*-}
+ else
+ export jvm_num=${3#*-}
+ fi
+fi
+
+#set debug-port
+function setport()
+{
+ if [ "$debug_port" != "" ]; then
+ pid=`lsof -i :$debug_port | grep -v "PID"`
+ if [ "$pid" != "" ];then
+ echo "$debug_port already used"
+ echo "The port is already in use, please check before installing"
+ exit 1
+ fi
+ sed -i "s/#export DEBUG_PORT=/export DEBUG_PORT=${debug_port}/g"
$SERVER_START_BIN
+ echo "$debug_port"
+ fi
+}
+
+#set jvm
+function setjvm()
+{
+ if [ "$jvm_num" != "" ]; then
+ sed -i "s/#export DYNAMIC_JVM=/export DYNAMIC_JVM=${jvm_num}/g"
$SERVER_START_COMMON
+ fi
+}
+
# set LINKIS_HOME
if [ "$LINKIS_HOME" = "" ]; then
export LINKIS_HOME=$INSTALL_HOME
@@ -66,6 +113,7 @@ function start()
fi
fi
export SERVER_START_BIN=$LINKIS_HOME/sbin/ext/linkis-$SERVER_NAME
+ export SERVER_START_COMMON=$LINKIS_HOME/sbin/ext/linkis-common-start
if [[ ! -f "${SERVER_START_BIN}" ]]; then
echo "The $SERVER_NAME is wrong or the corresponding startup script does
not exist: "
echo "$SERVER_START_BIN"
@@ -73,6 +121,10 @@ function start()
else
echo "Start server, startup script: $SERVER_START_BIN"
export SERVER_NAME=linkis-$SERVER_NAME
+ sed -i "/.*export DYNAMIC_JVM*/c\#export DYNAMIC_JVM="
$SERVER_START_COMMON
+ sed -i "/.*export DEBUG_PORT*/c\#export DEBUG_PORT=" $SERVER_START_BIN
+ setjvm
+ setport
sh $SERVER_START_BIN
fi
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]