You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2022/11/24 08:24:38 UTC

[iotdb] branch master updated: Remove start-new-server scripts (#8128)

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

haonan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new ce92432c8c Remove start-new-server scripts (#8128)
ce92432c8c is described below

commit ce92432c8c6b6f9c8a28484e1f7571b832abeeab
Author: Haonan <hh...@outlook.com>
AuthorDate: Thu Nov 24 16:24:33 2022 +0800

    Remove start-new-server scripts (#8128)
---
 .../assembly/resources/sbin/start-new-server.bat   | 167 --------------
 .../assembly/resources/sbin/start-new-server.sh    | 249 ---------------------
 2 files changed, 416 deletions(-)

diff --git a/server/src/assembly/resources/sbin/start-new-server.bat b/server/src/assembly/resources/sbin/start-new-server.bat
deleted file mode 100644
index 344bf353c1..0000000000
--- a/server/src/assembly/resources/sbin/start-new-server.bat
+++ /dev/null
@@ -1,167 +0,0 @@
-@REM
-@REM Licensed to the Apache Software Foundation (ASF) under one
-@REM or more contributor license agreements.  See the NOTICE file
-@REM distributed with this work for additional information
-@REM regarding copyright ownership.  The ASF licenses this file
-@REM to you under the Apache License, Version 2.0 (the
-@REM "License"); you may not use this file except in compliance
-@REM with the License.  You may obtain a copy of the License at
-@REM
-@REM     http://www.apache.org/licenses/LICENSE-2.0
-@REM
-@REM Unless required by applicable law or agreed to in writing,
-@REM software distributed under the License is distributed on an
-@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-@REM KIND, either express or implied.  See the License for the
-@REM specific language governing permissions and limitations
-@REM under the License.
-@REM
-
-@echo off
-echo ````````````````````````
-echo Starting IoTDB
-echo ````````````````````````
-
-
-set PATH="%JAVA_HOME%\bin\";%PATH%
-set "FULL_VERSION="
-set "MAJOR_VERSION="
-set "MINOR_VERSION="
-
-
-for /f tokens^=2-5^ delims^=.-_+^" %%j in ('java -fullversion 2^>^&1') do (
-	set "FULL_VERSION=%%j-%%k-%%l-%%m"
-	IF "%%j" == "1" (
-	    set "MAJOR_VERSION=%%k"
-	    set "MINOR_VERSION=%%l"
-	) else (
-	    set "MAJOR_VERSION=%%j"
-	    set "MINOR_VERSION=%%k"
-	)
-)
-
-set JAVA_VERSION=%MAJOR_VERSION%
-
-@REM we do not check jdk that version less than 1.8 because they are too stale...
-IF "%JAVA_VERSION%" == "6" (
-	echo IoTDB only supports jdk >= 8, please check your java version.
-	goto finally
-)
-IF "%JAVA_VERSION%" == "7" (
-	echo IoTDB only supports jdk >= 8, please check your java version.
-	goto finally
-)
-
-if "%OS%" == "Windows_NT" setlocal
-
-pushd %~dp0..
-if NOT DEFINED IOTDB_HOME set IOTDB_HOME=%cd%
-popd
-
-set IOTDB_CONF=%IOTDB_HOME%\conf
-set IOTDB_LOGS=%IOTDB_HOME%\logs
-
-@setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
-set is_conf_path=false
-for %%i in (%*) do (
-	IF "%%i" == "-c" (
-		set is_conf_path=true
-	) ELSE IF "!is_conf_path!" == "true" (
-		set is_conf_path=false
-		set IOTDB_CONF=%%i
-	) ELSE (
-		set CONF_PARAMS=!CONF_PARAMS! %%i
-	)
-)
-
-IF EXIST "%IOTDB_CONF%\datanode-env.bat" (
-    CALL "%IOTDB_CONF%\datanode-env.bat" %1
-    ) ELSE (
-    echo "can't find %IOTDB_CONF%\datanode-env.bat"
-    )
-
-if NOT DEFINED MAIN_CLASS set MAIN_CLASS=org.apache.iotdb.db.service.NewIoTDB
-if NOT DEFINED JAVA_HOME goto :err
-
-@REM -----------------------------------------------------------------------------
-@REM JVM Opts we'll use in legacy run or installation
-set JAVA_OPTS=-ea^
- -Dlogback.configurationFile="%IOTDB_CONF%\logback-datanode.xml"^
- -DIOTDB_HOME="%IOTDB_HOME%"^
- -DTSFILE_HOME="%IOTDB_HOME%"^
- -DTSFILE_CONF="%IOTDB_CONF%"^
- -DIOTDB_CONF="%IOTDB_CONF%"^
- -Dsun.jnu.encoding=UTF-8^
- -Dfile.encoding=UTF-8
-
-@REM ***** CLASSPATH library setting *****
-@REM Ensure that any user defined CLASSPATH variables are not used on startup
-if EXIST %IOTDB_HOME%\lib (set CLASSPATH="%IOTDB_HOME%\lib\*") else set CLASSPATH="%IOTDB_HOME%\..\lib\*"
-set CLASSPATH=%CLASSPATH%;iotdb.NewIoTDB
-goto okClasspath
-
-:append
-set CLASSPATH=%CLASSPATH%;%1
-
-goto :eof
-
-@REM -----------------------------------------------------------------------------
-:okClasspath
-
-rem echo CLASSPATH: %CLASSPATH%
-
-@REM SET PARA
-
-@REM Before v0.14, iotdb-server runs in foreground by default
-@REM set foreground=0
-set foreground=yes
-
-:checkPara
-set COMMANSLINE=%*
-@REM setlocal ENABLEDELAYEDEXPANSION
-:STR_VISTOR
-for /f "tokens=1* delims= " %%a in ("%COMMANSLINE%") do (
-@REM -----more para-----
-for /f "tokens=1* delims==" %%1 in ("%%a") do (
-@REM echo 1=%%1 "|||" 2=%%2
-if "%%1"=="-v" ( java %JAVA_OPTS% -Dlogback.configurationFile="%IOTDB_CONF%/logback-tool.xml" -cp %CLASSPATH% org.apache.iotdb.db.service.GetVersion & goto finally )
-if "%%1"=="-f" ( set foreground=yes)
-if "%%1"=="-b" ( set foreground=0)
-)
-set COMMANSLINE=%%b
-goto STR_VISTOR
-)
-
-@REM SETLOCAL DISABLEDELAYEDEXPANSION
-
-echo ````````````````````````
-echo Starting IoTDB
-echo ````````````````````````
-
-@REM ----------------------------------------------------------------------------
-@REM SOURCE iotdb-env.bat
-IF EXIST "%IOTDB_CONF%\iotdb-env.bat" (
-    CALL "%IOTDB_CONF%\iotdb-env.bat" %1
-    ) ELSE (
-    echo "can't find %IOTDB_CONF%\iotdb-env.bat"
-    )
-if NOT DEFINED MAIN_CLASS set MAIN_CLASS=org.apache.iotdb.db.service.IoTDB
-if NOT DEFINED JAVA_HOME goto :err
-
-@REM ----------------------------------------------------------------------------
-@REM START
-:start
-if %foreground%==yes (
-	java %ILLEGAL_ACCESS_PARAMS% %JAVA_OPTS% %IOTDB_HEAP_OPTS% -cp %CLASSPATH% %IOTDB_JMX_OPTS% %MAIN_CLASS% %CONF_PARAMS%
-	) ELSE (
-	start javaw %ILLEGAL_ACCESS_PARAMS% %JAVA_OPTS% %IOTDB_HEAP_OPTS% -cp %CLASSPATH% %IOTDB_JMX_OPTS% %MAIN_CLASS% %CONF_PARAMS%
-	)
-goto finally
-
-:err
-echo JAVA_HOME environment variable must be set!
-pause
-
-:finally
-@ENDLOCAL
-pause
\ No newline at end of file
diff --git a/server/src/assembly/resources/sbin/start-new-server.sh b/server/src/assembly/resources/sbin/start-new-server.sh
deleted file mode 100644
index 314e096e28..0000000000
--- a/server/src/assembly/resources/sbin/start-new-server.sh
+++ /dev/null
@@ -1,249 +0,0 @@
-#!/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.
-#
-
-#start-new-server.sh may be deleted in the future, therefore we keep it duplicate with start-datanode.sh
-#except for  classname
-
-source "$(dirname "$0")/iotdb-common.sh"
-
-# iotdb server runs on foreground by default
-foreground="yes"
-
-IOTDB_HEAP_DUMP_COMMAND=""
-
-while true; do
-    case "$1" in
-        -c)
-            IOTDB_CONF="$2"
-            shift 2
-            ;;
-        -p)
-            pidfile="$2"
-            shift 2
-        ;;
-        -f)
-            foreground="yes"
-            shift
-        ;;
-        -b)
-            foreground=""
-            shift
-        ;;
-        -g)
-            PRINT_GC="yes"
-            shift
-        ;;
-        -H)
-            IOTDB_HEAP_DUMP_COMMAND="$IOTDB_HEAP_DUMP_COMMAND -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=$2"
-            shift 2
-        ;;
-        -E)
-            IOTDB_JVM_OPTS="$IOTDB_JVM_OPTS -XX:ErrorFile=$2"
-            shift 2
-        ;;
-        -D)
-            IOTDB_JVM_OPTS="$IOTDB_JVM_OPTS -D$2"
-            #checkEnvVariables is in iotdb-common.sh
-            checkEnvVariables $2
-            shift 2
-        ;;
-        -X)
-            IOTDB_JVM_OPTS="$IOTDB_JVM_OPTS -XX:$2"
-            shift 2
-        ;;
-        -h)
-            echo "Usage: $0 [-v] [-f] [-b] [-h] [-p pidfile] [-c configFolder] [-H HeapDumpPath] [-E JvmErrorFile] [printgc]"
-            exit 0
-        ;;
-        -v)
-            SHOW_VERSION="yes"
-            break
-        ;;
-        --)
-            shift
-            #all others are args to the program
-            PARAMS=$*
-            break
-        ;;
-        "")
-            #if we do not use getopt, we then have to process the case that there is no argument.
-            #in some systems, when there is no argument, shift command may throw error, so we skip directly
-            #all others are args to the program
-            PARAMS=$*
-            break
-        ;;
-        *)
-            echo "Error parsing arguments! Unknown argument \"$1\"" >&2
-            exit 1
-        ;;
-    esac
-done
-
-#checkAllVariables is in iotdb-common.sh
-checkAllVariables
-
-CLASSPATH=""
-for f in ${IOTDB_HOME}/lib/*.jar; do
-  CLASSPATH=${CLASSPATH}":"$f
-done
-
-
-
-classname=org.apache.iotdb.db.service.NewIoTDB
-
-if [ "x$SHOW_VERSION" != "x" ]; then
-    classname=org.apache.iotdb.db.service.GetVersion
-    IOTDB_LOG_CONFIG="${IOTDB_CONF}/logback-tool.xml"
-    # find java in JAVA_HOME
-    if [ -n "$JAVA_HOME" ]; then
-        for java in "$JAVA_HOME"/bin/amd64/java "$JAVA_HOME"/bin/java; do
-            if [ -x "$java" ]; then
-                JAVA="$java"
-                break
-            fi
-        done
-    else
-        JAVA=java
-    fi
-    exec "$JAVA" -cp "$CLASSPATH" $IOTDB_JVM_OPTS "-Dlogback.configurationFile=${IOTDB_LOG_CONFIG}" "$classname"
-    exit 0
-fi
-
-echo ---------------------
-echo "Starting IoTDB"
-echo ---------------------
-
-#initEnv is in iotdb-common.sh
-initEnv
-
-# check whether we can enable heap dump when oom
-if [ "x$IOTDB_ALLOW_HEAP_DUMP" == "xtrue" ]; then
-  IOTDB_JVM_OPTS="$IOTDB_JVM_OPTS $IOTDB_HEAP_DUMP_COMMAND"
-fi
-
-launch_service()
-{
-	class="$1"
-  iotdb_parms="-Dlogback.configurationFile=${IOTDB_LOG_CONFIG}"
-	iotdb_parms="$iotdb_parms -DIOTDB_HOME=${IOTDB_HOME}"
-	iotdb_parms="$iotdb_parms -DIOTDB_DATA_HOME=${IOTDB_DATA_HOME}"
-	iotdb_parms="$iotdb_parms -DTSFILE_HOME=${IOTDB_HOME}"
-	iotdb_parms="$iotdb_parms -DIOTDB_CONF=${IOTDB_CONF}"
-	iotdb_parms="$iotdb_parms -DTSFILE_CONF=${IOTDB_CONF}"
-	iotdb_parms="$iotdb_parms -Dname=iotdb\.IoTDB"
-	iotdb_parms="$iotdb_parms -DIOTDB_LOG_DIR=${IOTDB_LOG_DIR}"
-
-	  if [ "x$pidfile" != "x" ]; then
-       iotdb_parms="$iotdb_parms -Diotdb-pidfile=$pidfile"
-    fi
-
-  # The iotdb-foreground option will tell IoTDB not to close stdout/stderr, but it's up to us not to background.
-    if [ "x$foreground" == "xyes" ]; then
-        iotdb_parms="$iotdb_parms -Diotdb-foreground=yes"
-        if [ "x$JVM_ON_OUT_OF_MEMORY_ERROR_OPT" != "x" ]; then
-          [ ! -z "$pidfile" ] && printf "%d" $! > "$pidfile"
-            exec $NUMACTL "$JAVA" $JVM_OPTS "$JVM_ON_OUT_OF_MEMORY_ERROR_OPT" $illegal_access_params $iotdb_parms $IOTDB_JMX_OPTS -cp "$CLASSPATH" $IOTDB_JVM_OPTS "$class" $PARAMS
-        else
-            [ ! -z "$pidfile" ] && printf "%d" $! > "$pidfile"
-            exec $NUMACTL "$JAVA" $JVM_OPTS $illegal_access_params $iotdb_parms $IOTDB_JMX_OPTS -cp "$CLASSPATH" $IOTDB_JVM_OPTS "$class" $PARAMS
-        fi
-    # Startup IoTDB, background it, and write the pid.
-    else
-        if [ "x$JVM_ON_OUT_OF_MEMORY_ERROR_OPT" != "x" ]; then
-              exec $NUMACTL "$JAVA" $JVM_OPTS "$JVM_ON_OUT_OF_MEMORY_ERROR_OPT" $illegal_access_params $iotdb_parms $IOTDB_JMX_OPTS -cp "$CLASSPATH" $IOTDB_JVM_OPTS "$class" $PARAMS 2>&1 > /dev/null  <&- &
-              [ ! -z "$pidfile" ] && printf "%d" $! > "$pidfile"
-              true
-        else
-              exec $NUMACTL "$JAVA" $JVM_OPTS $illegal_access_params $iotdb_parms $IOTDB_JMX_OPTS -cp "$CLASSPATH" $IOTDB_JVM_OPTS "$class" $PARAMS 2>&1 > /dev/null <&- &
-              [ ! -z "$pidfile" ] && printf "%d" $! > "$pidfile"
-              true
-        fi
-    fi
-
-	return $?
-}
-
-
-# check whether tool 'lsof' exists
-check_tool_env() {
-  if  ! type lsof > /dev/null 2>&1 ; then
-    echo ""
-    echo " Warning: No tool 'lsof', Please install it."
-    echo " Note: Some checking function need 'lsof'."
-    echo ""
-    return 1
-  else
-    return 0
-  fi
-}
-
-# convert path to real full-path.
-# If path has been deleted, return ""
-get_real_path() {
-  local path=$1
-  local real_path=""
-  cd $path > /dev/null 2>&1
-  if [ $? -eq 0 ] ; then
-    real_path=$(pwd -P)
-    cd -  > /dev/null 2>&1
-  fi
-  echo "${real_path}"
-}
-
-# check whether same directory's IotDB server process has been running
-check_running_process() {
-  check_tool_env
-
-  PIDS=$(ps ax | grep "$classname" | grep java | grep DIOTDB_HOME | grep -v grep | awk '{print $1}')
-  for pid in ${PIDS}
-  do
-    run_conf_path=""
-    run_cwd=$(lsof -p $pid 2>/dev/null | awk '$4~/cwd/ {print $NF}')
-    run_home_path=$(ps -fp $pid | sed "s/ /\n/g" | sed -n "s/-DIOTDB_HOME=//p")
-    run_home_path=$(get_real_path "${run_cwd}/${run_home_path}")
-
-    #if dir ${run_home_path} has been deleted
-    if [ "${run_home_path}" == "" ]; then
-      continue
-    fi
-
-    current_home_path=$(get_real_path ${IOTDB_HOME})
-    if [ "${run_home_path}" == "${current_home_path}" ]; then
-      echo ""
-      echo " Found running IoTDB server (PID=$pid)."  >&2
-      echo " Can not run duplicated IoTDB server!"  >&2
-      echo " Exit..."  >&2
-      echo ""
-      exit 1
-    fi
-  done
-}
-
-
-check_tool_env
-# If needed tool is ready, check whether same directory's IotDB server is running
-if [ $? -eq 0 ]; then
-  check_running_process
-fi
-
-# Start up the service
-launch_service "$classname"
-
-exit $?