You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampark.apache.org by be...@apache.org on 2023/02/03 09:14:20 UTC

[incubator-streampark] branch dev updated: [Feature][Issue-2292] streampark.sh starts adding debug mode (#2288)

This is an automated email from the ASF dual-hosted git repository.

benjobs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git


The following commit(s) were added to refs/heads/dev by this push:
     new e0bd37b62 [Feature][Issue-2292] streampark.sh  starts adding debug mode (#2288)
e0bd37b62 is described below

commit e0bd37b624e2adde9042bcab4d357b695680c26d
Author: zhangxiangyang <10...@qq.com>
AuthorDate: Fri Feb 3 17:14:13 2023 +0800

    [Feature][Issue-2292] streampark.sh  starts adding debug mode (#2288)
    
    * streampark.sh  start adding debug mode
---
 .../src/main/assembly/bin/streampark.sh                 | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/streampark-console/streampark-console-service/src/main/assembly/bin/streampark.sh b/streampark-console/streampark-console-service/src/main/assembly/bin/streampark.sh
index 8d30ed702..45d02a612 100755
--- a/streampark-console/streampark-console-service/src/main/assembly/bin/streampark.sh
+++ b/streampark-console/streampark-console-service/src/main/assembly/bin/streampark.sh
@@ -357,6 +357,7 @@ start() {
   -XX:CMSInitiatingOccupancyFraction=70
   -XX:ThreadStackSize=512
   -Xloggc:${APP_HOME}/logs/gc.log
+  $DEBUG_OPTS
   """
 
   eval $NOHUP "\"$_RUNJAVA\"" $JAVA_OPTS \
@@ -396,6 +397,17 @@ start() {
    fi
 }
 
+debug() {
+  if [ ! -n "$DEBUG_PORT" ]; then
+    echo_r "If start with debug mode,Please fill in the debug port like: bash streampark.sh debug 10002 "
+  else
+    DEBUG_OPTS="""
+    -Xdebug  -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=$DEBUG_PORT
+    """
+    start
+  fi
+}
+
 # shellcheck disable=SC2120
 stop() {
   running
@@ -546,6 +558,10 @@ restart() {
 main() {
   print_logo
   case "$1" in
+    "debug")
+        DEBUG_PORT=$2
+        debug
+        ;;
     "start")
         start
         ;;
@@ -565,6 +581,7 @@ main() {
         echo_w "  start \$conf               Start StreamPark with application config."
         echo_w "  stop n -force             Stop StreamPark, wait up to n seconds and then use kill -KILL if still running"
         echo_w "  status                    StreamPark status"
+        echo_w "  debug                     StreamPark start with debug mode,start debug mode, like: bash streampark.sh debug 10002"
         echo_w "  restart \$conf             restart StreamPark with application config."
         exit 0
         ;;