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/04 07:32:35 UTC

[iotdb] branch fix_shell created (now 8c8f90d2d4)

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

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


      at 8c8f90d2d4 Fix shell scripts in tools and change -b to -d

This branch includes the following new commits:

     new 8c8f90d2d4 Fix shell scripts in tools and change -b to -d

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[iotdb] 01/01: Fix shell scripts in tools and change -b to -d

Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 8c8f90d2d4db17dab5bb017358be44aef4f7e138
Author: HTHou <hh...@outlook.com>
AuthorDate: Fri Nov 4 15:30:17 2022 +0800

    Fix shell scripts in tools and change -b to -d
---
 .../assembly/resources/sbin/start-confignode.bat   |   2 +-
 .../assembly/resources/sbin/start-confignode.sh    |   4 +-
 docs/UserGuide/QuickStart/QuickStart.md            |   2 +-
 docs/zh/UserGuide/QuickStart/QuickStart.md         |   4 +-
 .../src/assembly/resources/sbin/start-datanode.bat |   2 +-
 .../src/assembly/resources/sbin/start-datanode.sh  |   4 +-
 .../src/assembly/resources/sbin/start-server.bat   | 177 ---------------
 server/src/assembly/resources/sbin/start-server.sh | 249 ---------------------
 server/src/assembly/resources/sbin/stop-server.bat |  38 ----
 server/src/assembly/resources/sbin/stop-server.sh  |  74 ------
 .../assembly/resources/tools/detect-watermark.sh   |   2 +-
 .../assembly/resources/tools/rocksdb-transfer.bat  |   2 +-
 .../assembly/resources/tools/rocksdb-transfer.sh   |   2 +-
 .../resources/tools/schema/SchemaFileSketcher.sh   |   3 +-
 .../assembly/resources/tools/schema/mLogParser.sh  |   3 +-
 .../assembly/resources/tools/start-WalChecker.bat  |   2 +-
 .../assembly/resources/tools/start-WalChecker.sh   |   4 +-
 .../tools/tsfileToolSet/print-iotdb-data-dir.sh    |   3 +-
 .../tsfileToolSet/print-tsfile-resource-files.sh   |   3 +-
 .../tools/tsfileToolSet/print-tsfile-sketch.sh     |   3 +-
 .../tools/tsfileToolSet/print-tsfile-visdata.sh    |   3 +-
 .../resources/tools/tsfileToolSet/settle.sh        |   3 +-
 .../tools/tsfileToolSet/split-tsfile-tool.sh       |   3 +-
 .../tools/tsfileToolSet/validate-tsfile.sh         |   3 +-
 24 files changed, 33 insertions(+), 562 deletions(-)

diff --git a/confignode/src/assembly/resources/sbin/start-confignode.bat b/confignode/src/assembly/resources/sbin/start-confignode.bat
index c1fff0fe78..c42041e2db 100644
--- a/confignode/src/assembly/resources/sbin/start-confignode.bat
+++ b/confignode/src/assembly/resources/sbin/start-confignode.bat
@@ -119,7 +119,7 @@ for /f "tokens=1* delims==" %%1 in ("%%a") do (
 @REM echo 1=%%1 "|||" 2=%%2
 if "%%1"=="-v" ( java %JAVA_OPTS% -Dlogback.configurationFile="%CONFIGNODE_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)
+if "%%1"=="-d" ( set foreground=0)
 )
 set COMMANSLINE=%%b
 goto STR_VISTOR
diff --git a/confignode/src/assembly/resources/sbin/start-confignode.sh b/confignode/src/assembly/resources/sbin/start-confignode.sh
index 3b1096136e..b522f92c12 100644
--- a/confignode/src/assembly/resources/sbin/start-confignode.sh
+++ b/confignode/src/assembly/resources/sbin/start-confignode.sh
@@ -46,7 +46,7 @@ while true; do
             foreground="yes"
             shift
         ;;
-        -b)
+        -d)
             foreground=""
             shift
         ;;
@@ -73,7 +73,7 @@ while true; do
             shift 2
         ;;
         -h)
-            echo "Usage: $0 [-v] [-f] [-b] [-h] [-p pidfile] [-c configFolder] [-H HeapDumpPath] [-E JvmErrorFile] [printgc]"
+            echo "Usage: $0 [-v] [-f] [-d] [-h] [-p pidfile] [-c configFolder] [-H HeapDumpPath] [-E JvmErrorFile] [printgc]"
             exit 0
         ;;
         -v)
diff --git a/docs/UserGuide/QuickStart/QuickStart.md b/docs/UserGuide/QuickStart/QuickStart.md
index 2d5da1ba6d..7e18060787 100644
--- a/docs/UserGuide/QuickStart/QuickStart.md
+++ b/docs/UserGuide/QuickStart/QuickStart.md
@@ -75,7 +75,7 @@ parameters:
 - by default, iotdb will run in the background
 - "-v": show iotdb version
 - "-f": run iotdb on the foreground and print logs on the console (by default)
-- "-b": run iotdb in the background which does not print logs on the console
+- "-d": run iotdb in the background which does not print logs on the console
 - "-p \<pidfile\>": save the pid into target pidfile
 - "-h": help
 - "printgc"(must be at the end of the command): print the GC log 
diff --git a/docs/zh/UserGuide/QuickStart/QuickStart.md b/docs/zh/UserGuide/QuickStart/QuickStart.md
index b2563ae291..d277f28c02 100644
--- a/docs/zh/UserGuide/QuickStart/QuickStart.md
+++ b/docs/zh/UserGuide/QuickStart/QuickStart.md
@@ -59,13 +59,13 @@ Linux 系统与 MacOS 系统启动命令如下:
 ```
 > nohup sbin/start-server.sh -f >/dev/null 2>&1 &
 or
-> nohup sbin/start-server.sh -b
+> nohup sbin/start-server.sh -d
 ```
 可选参数:
 - 默认不含任何参数时, iotdb 将在后台启动,并且不在控制台打印日志
 - "-v": 查看iotdb版本
 - "-f": 在控制台前台启动iotdb (v0.14前是默认设置)
-- "-b": 在后台启动iotdb,控制台不打印日志
+- "-d": 在后台启动iotdb,控制台不打印日志
 - "-p \<pidfile\>": 将pid保存到指定的文件中
 - "-h": 查看帮助
 - "printgc"(必须是最后一个参数): 打印GC日志 (从v0.14起,该参数将被-g取代)
diff --git a/server/src/assembly/resources/sbin/start-datanode.bat b/server/src/assembly/resources/sbin/start-datanode.bat
index b11659a783..1597894d91 100755
--- a/server/src/assembly/resources/sbin/start-datanode.bat
+++ b/server/src/assembly/resources/sbin/start-datanode.bat
@@ -141,7 +141,7 @@ 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)
+if "%%1"=="-d" ( set foreground=0)
 )
 set COMMANSLINE=%%b
 goto STR_VISTOR
diff --git a/server/src/assembly/resources/sbin/start-datanode.sh b/server/src/assembly/resources/sbin/start-datanode.sh
index f294e84d5b..1c78fb3ad8 100755
--- a/server/src/assembly/resources/sbin/start-datanode.sh
+++ b/server/src/assembly/resources/sbin/start-datanode.sh
@@ -41,7 +41,7 @@ while true; do
             foreground="yes"
             shift
         ;;
-        -b)
+        -d)
             foreground=""
             shift
         ;;
@@ -68,7 +68,7 @@ while true; do
             shift 2
         ;;
         -h)
-            echo "Usage: $0 [-v] [-f] [-b] [-h] [-p pidfile] [-c configFolder] [-H HeapDumpPath] [-E JvmErrorFile] [printgc]"
+            echo "Usage: $0 [-v] [-f] [-d] [-h] [-p pidfile] [-c configFolder] [-H HeapDumpPath] [-E JvmErrorFile] [printgc]"
             exit 0
         ;;
         -v)
diff --git a/server/src/assembly/resources/sbin/start-server.bat b/server/src/assembly/resources/sbin/start-server.bat
deleted file mode 100755
index 78cca66635..0000000000
--- a/server/src/assembly/resources/sbin/start-server.bat
+++ /dev/null
@@ -1,177 +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 ````````````````````````
-
-@REM -----------------------------------------------------------------------------
-@REM SET JAVA
-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
-)
-
-@REM -----------------------------------------------------------------------------
-@REM SET DIR
-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.IoTDB
-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 ----------------------------------------------------------------------------
-@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.IoTDB
-goto okClasspath
-
-:append
-set CLASSPATH=%CLASSPATH%;%1
-
-goto :eof
-
-@REM -----------------------------------------------------------------------------
-:okClasspath
-
-rem echo CLASSPATH: %CLASSPATH%
-
-@REM ----------------------------------------------------------------------------
-@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
-
-
-@REM -----------------------------------------------------------------------------
-:finally
-@ENDLOCAL
-
-pause
-
diff --git a/server/src/assembly/resources/sbin/start-server.sh b/server/src/assembly/resources/sbin/start-server.sh
deleted file mode 100755
index 69ebaeedf3..0000000000
--- a/server/src/assembly/resources/sbin/start-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-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.IoTDB
-
-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 $?
diff --git a/server/src/assembly/resources/sbin/stop-server.bat b/server/src/assembly/resources/sbin/stop-server.bat
deleted file mode 100755
index 1aa1933dfa..0000000000
--- a/server/src/assembly/resources/sbin/stop-server.bat
+++ /dev/null
@@ -1,38 +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
-
-set current_dir=%~dp0
-set superior_dir=%current_dir%\..\
-
-for /f  "eol=; tokens=2,2 delims==" %%i in ('findstr /i "^rpc_port"
-%superior_dir%\conf\iotdb-datanode.properties') do (
-  set rpc_port=%%i
-)
-
-for /f  "eol=; tokens=2,2 delims==" %%i in ('findstr /i "rpc_address"
-%superior_dir%\conf\iotdb-datanode.properties') do (
-  set rpc_address=%%i
-)
-
-for /f "tokens=5" %%a in ('netstat /ano ^| findstr %rpc_address%:%rpc_port%') do (
-  taskkill /f /pid %%a
-)
-rem ps ax | grep -i 'iotdb.IoTDB' | grep -v grep | awk '{print $1}' | xargs kill -SIGTERM
diff --git a/server/src/assembly/resources/sbin/stop-server.sh b/server/src/assembly/resources/sbin/stop-server.sh
deleted file mode 100755
index 712c91a6d3..0000000000
--- a/server/src/assembly/resources/sbin/stop-server.sh
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/bin/sh
-#
-# 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.
-#
-
-IOTDB_CONF="`dirname "$0"`/../conf"
-rpc_port=`sed '/^rpc_port=/!d;s/.*=//' ${IOTDB_CONF}/iotdb-datanode.properties`
-PID=""
-
-function getPid {
-  if  type lsof > /dev/null 2>&1 ; then
-    PID=$(lsof -t -i:${rpc_port} -sTCP:LISTEN)
-  elif type netstat > /dev/null 2>&1 ; then
-    PID=$(netstat -anp 2>/dev/null | grep ":${rpc_port} " | grep ' LISTEN ' | awk '{print $NF}' | sed "s|/.*||g" )
-  else
-    echo ""
-    echo " Error: No necessary tool."
-    echo " Please install 'lsof' or 'netstat'."
-    exit 1
-  fi
-}
-
-getPid
-if [ -z "$PID" ]; then
-  echo "No IoTDB server to stop."
-  exit 1
-fi
-
-PIDS=$(ps ax | grep -i 'IoTDB' | grep java | grep -v grep | awk '{print $1}')
-sig=0
-for every_pid in ${PIDS}
-do
-  if [ "$every_pid" = "$PID" ]; then
-    sig=1
-    break
-  fi
-done
-
-if [ $sig -eq 0 ]; then
-  echo "No IoTDB server to stop"
-  exit 1
-fi
-
-echo -n "Begin to stop IoTDB ..."
-kill -s TERM $PID
-for ((i=1; i<=1000;i++))   #check status in 100 sec
-do
-  if [ ! -d "/proc/$PID" ]; then
-    echo " closed gracefully."
-    exit 0
-  fi
-  if [ $((i%10)) -eq 0 ]; then
-    echo -n "."
-  fi
-  usleep 100000
-done
-
-kill -s KILL $PID
-echo " forced to kill."
diff --git a/server/src/assembly/resources/tools/detect-watermark.sh b/server/src/assembly/resources/tools/detect-watermark.sh
index 97b3706d6a..a231d334df 100644
--- a/server/src/assembly/resources/tools/detect-watermark.sh
+++ b/server/src/assembly/resources/tools/detect-watermark.sh
@@ -18,7 +18,7 @@
 # under the License.
 #
 
-source "$(dirname "$0")/iotdb-common.sh"
+source "$(dirname "$0")/../sbin/iotdb-common.sh"
 #get_iotdb_include and checkAllVariables is in iotdb-common.sh
 VARS=$(get_iotdb_include "$*")
 checkAllVariables
diff --git a/server/src/assembly/resources/tools/rocksdb-transfer.bat b/server/src/assembly/resources/tools/rocksdb-transfer.bat
index 06cc4c18dd..0f8f7e281e 100644
--- a/server/src/assembly/resources/tools/rocksdb-transfer.bat
+++ b/server/src/assembly/resources/tools/rocksdb-transfer.bat
@@ -86,7 +86,7 @@ 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.xml"^
+ -Dlogback.configurationFile="%IOTDB_CONF%\logback-datanode.xml"^
  -DIOTDB_HOME="%IOTDB_HOME%"^
  -DTSFILE_HOME="%IOTDB_HOME%"^
  -DTSFILE_CONF="%IOTDB_CONF%"^
diff --git a/server/src/assembly/resources/tools/rocksdb-transfer.sh b/server/src/assembly/resources/tools/rocksdb-transfer.sh
index a4e05212a6..bad3134908 100644
--- a/server/src/assembly/resources/tools/rocksdb-transfer.sh
+++ b/server/src/assembly/resources/tools/rocksdb-transfer.sh
@@ -66,7 +66,7 @@ classname=org.apache.iotdb.db.metadata.rocksdb.MetaDataTransfer
 launch_service()
 {
 	class="$1"
-	iotdb_parms="-Dlogback.configurationFile=${IOTDB_CONF}/logback.xml"
+	iotdb_parms="-Dlogback.configurationFile=${IOTDB_CONF}/logback-datanode.xml"
 	iotdb_parms="$iotdb_parms -DIOTDB_HOME=${IOTDB_HOME}"
 	iotdb_parms="$iotdb_parms -DTSFILE_HOME=${IOTDB_HOME}"
 	iotdb_parms="$iotdb_parms -DIOTDB_CONF=${IOTDB_CONF}"
diff --git a/server/src/assembly/resources/tools/schema/SchemaFileSketcher.sh b/server/src/assembly/resources/tools/schema/SchemaFileSketcher.sh
index 0692993472..8bc98a4285 100644
--- a/server/src/assembly/resources/tools/schema/SchemaFileSketcher.sh
+++ b/server/src/assembly/resources/tools/schema/SchemaFileSketcher.sh
@@ -22,10 +22,11 @@ echo ---------------------
 echo Starting Sketching the IoTDB SchemaFile
 echo ---------------------
 
-source "$(dirname "$0")/iotdb-common.sh"
+source "$(dirname "$0")/../../sbin/iotdb-common.sh"
 #get_iotdb_include and checkAllVariables is in iotdb-common.sh
 VARS=$(get_iotdb_include "$*")
 checkAllVariables
+export IOTDB_HOME="${IOTDB_HOME}/.."
 eval set -- "$VARS"
 
 if [ -n "$JAVA_HOME" ]; then
diff --git a/server/src/assembly/resources/tools/schema/mLogParser.sh b/server/src/assembly/resources/tools/schema/mLogParser.sh
index 0b8d4b8bee..6003249684 100644
--- a/server/src/assembly/resources/tools/schema/mLogParser.sh
+++ b/server/src/assembly/resources/tools/schema/mLogParser.sh
@@ -22,10 +22,11 @@ echo ---------------------
 echo Starting Parsing the IoTDB Mlog or Snapshot
 echo ---------------------
 
-source "$(dirname "$0")/iotdb-common.sh"
+source "$(dirname "$0")/../../sbin/iotdb-common.sh"
 #get_iotdb_include and checkAllVariables is in iotdb-common.sh
 VARS=$(get_iotdb_include "$*")
 checkAllVariables
+export IOTDB_HOME="${IOTDB_HOME}/.."
 eval set -- "$VARS"
 
 if [ -n "$JAVA_HOME" ]; then
diff --git a/server/src/assembly/resources/tools/start-WalChecker.bat b/server/src/assembly/resources/tools/start-WalChecker.bat
index 4218efc81e..42a18afd8e 100644
--- a/server/src/assembly/resources/tools/start-WalChecker.bat
+++ b/server/src/assembly/resources/tools/start-WalChecker.bat
@@ -63,7 +63,7 @@ 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.xml"^
+ -Dlogback.configurationFile="%IOTDB_CONF%\logback-datanode.xml"^
  -DIOTDB_HOME="%IOTDB_HOME%"^
  -DTSFILE_HOME="%IOTDB_HOME%"^
  -DIOTDB_CONF="%IOTDB_CONF%"
diff --git a/server/src/assembly/resources/tools/start-WalChecker.sh b/server/src/assembly/resources/tools/start-WalChecker.sh
index c5ab3ca989..ccef41c9e0 100755
--- a/server/src/assembly/resources/tools/start-WalChecker.sh
+++ b/server/src/assembly/resources/tools/start-WalChecker.sh
@@ -23,7 +23,7 @@ echo ---------------------
 echo Starting WalChecker 
 echo ---------------------
 
-source "$(dirname "$0")/iotdb-common.sh"
+source "$(dirname "$0")/../sbin/iotdb-common.sh"
 #get_iotdb_include and checkAllVariables is in iotdb-common.sh
 VARS=$(get_iotdb_include "$*")
 checkAllVariables
@@ -63,7 +63,7 @@ classname=org.apache.iotdb.db.tools.WalChecker
 launch_service()
 {
 	class="$1"
-	iotdb_parms="-Dlogback.configurationFile=${IOTDB_CONF}/logback.xml"
+	iotdb_parms="-Dlogback.configurationFile=${IOTDB_CONF}/logback-datanode.xml"
 	iotdb_parms="$iotdb_parms -DIOTDB_HOME=${IOTDB_HOME}"
 	iotdb_parms="$iotdb_parms -DTSFILE_HOME=${IOTDB_HOME}"
 	iotdb_parms="$iotdb_parms -DIOTDB_CONF=${IOTDB_CONF}"
diff --git a/server/src/assembly/resources/tools/tsfileToolSet/print-iotdb-data-dir.sh b/server/src/assembly/resources/tools/tsfileToolSet/print-iotdb-data-dir.sh
index a9a98a6de5..9deb80b9c4 100644
--- a/server/src/assembly/resources/tools/tsfileToolSet/print-iotdb-data-dir.sh
+++ b/server/src/assembly/resources/tools/tsfileToolSet/print-iotdb-data-dir.sh
@@ -22,10 +22,11 @@ echo ---------------------
 echo Starting Printing the IoTDB Data Directory Overview
 echo ---------------------
 
-source "$(dirname "$0")/iotdb-common.sh"
+source "$(dirname "$0")/../../sbin/iotdb-common.sh"
 #get_iotdb_include and checkAllVariables is in iotdb-common.sh
 VARS=$(get_iotdb_include "$*")
 checkAllVariables
+export IOTDB_HOME="${IOTDB_HOME}/.."
 eval set -- "$VARS"
 
 
diff --git a/server/src/assembly/resources/tools/tsfileToolSet/print-tsfile-resource-files.sh b/server/src/assembly/resources/tools/tsfileToolSet/print-tsfile-resource-files.sh
index 312d009d2a..560deecc7f 100755
--- a/server/src/assembly/resources/tools/tsfileToolSet/print-tsfile-resource-files.sh
+++ b/server/src/assembly/resources/tools/tsfileToolSet/print-tsfile-resource-files.sh
@@ -23,10 +23,11 @@ echo ---------------------
 echo Starting Printing the TsFileResources
 echo ---------------------
 
-source "$(dirname "$0")/iotdb-common.sh"
+source "$(dirname "$0")/../../sbin/iotdb-common.sh"
 #get_iotdb_include and checkAllVariables is in iotdb-common.sh
 VARS=$(get_iotdb_include "$*")
 checkAllVariables
+export IOTDB_HOME="${IOTDB_HOME}/.."
 eval set -- "$VARS"
 
 
diff --git a/server/src/assembly/resources/tools/tsfileToolSet/print-tsfile-sketch.sh b/server/src/assembly/resources/tools/tsfileToolSet/print-tsfile-sketch.sh
index 90907f223f..35c26594f2 100755
--- a/server/src/assembly/resources/tools/tsfileToolSet/print-tsfile-sketch.sh
+++ b/server/src/assembly/resources/tools/tsfileToolSet/print-tsfile-sketch.sh
@@ -22,10 +22,11 @@ echo ---------------------
 echo Starting Printing the TsFile Sketch
 echo ---------------------
 
-source "$(dirname "$0")/iotdb-common.sh"
+source "$(dirname "$0")/../../sbin/iotdb-common.sh"
 #get_iotdb_include and checkAllVariables is in iotdb-common.sh
 VARS=$(get_iotdb_include "$*")
 checkAllVariables
+export IOTDB_HOME="${IOTDB_HOME}/.."
 eval set -- "$VARS"
 
 
diff --git a/server/src/assembly/resources/tools/tsfileToolSet/print-tsfile-visdata.sh b/server/src/assembly/resources/tools/tsfileToolSet/print-tsfile-visdata.sh
index 2d9593f746..981d1bc47e 100644
--- a/server/src/assembly/resources/tools/tsfileToolSet/print-tsfile-visdata.sh
+++ b/server/src/assembly/resources/tools/tsfileToolSet/print-tsfile-visdata.sh
@@ -22,10 +22,11 @@ echo ---------------------
 echo Starting Printing the TsFile Sketch
 echo ---------------------
 
-source "$(dirname "$0")/iotdb-common.sh"
+source "$(dirname "$0")/../../sbin/iotdb-common.sh"
 #get_iotdb_include and checkAllVariables is in iotdb-common.sh
 VARS=$(get_iotdb_include "$*")
 checkAllVariables
+export IOTDB_HOME="${IOTDB_HOME}/.."
 eval set -- "$VARS"
 
 if [ -n "$JAVA_HOME" ]; then
diff --git a/server/src/assembly/resources/tools/tsfileToolSet/settle.sh b/server/src/assembly/resources/tools/tsfileToolSet/settle.sh
index c08829fbfe..f122f13e69 100644
--- a/server/src/assembly/resources/tools/tsfileToolSet/settle.sh
+++ b/server/src/assembly/resources/tools/tsfileToolSet/settle.sh
@@ -22,10 +22,11 @@ echo ---------------------
 echo Starting Settling the TsFile
 echo ---------------------
 
-source "$(dirname "$0")/iotdb-common.sh"
+source "$(dirname "$0")/../../sbin/iotdb-common.sh"
 #get_iotdb_include and checkAllVariables is in iotdb-common.sh
 VARS=$(get_iotdb_include "$*")
 checkAllVariables
+export IOTDB_HOME="${IOTDB_HOME}/.."
 eval set -- "$VARS"
 
 if [ -n "$JAVA_HOME" ]; then
diff --git a/server/src/assembly/resources/tools/tsfileToolSet/split-tsfile-tool.sh b/server/src/assembly/resources/tools/tsfileToolSet/split-tsfile-tool.sh
index 91a11835b9..0af432f7f8 100644
--- a/server/src/assembly/resources/tools/tsfileToolSet/split-tsfile-tool.sh
+++ b/server/src/assembly/resources/tools/tsfileToolSet/split-tsfile-tool.sh
@@ -22,10 +22,11 @@ echo ---------------------
 echo Start Splitting TsFile
 echo ---------------------
 
-source "$(dirname "$0")/iotdb-common.sh"
+source "$(dirname "$0")/../../sbin/iotdb-common.sh"
 #get_iotdb_include and checkAllVariables is in iotdb-common.sh
 VARS=$(get_iotdb_include "$*")
 checkAllVariables
+export IOTDB_HOME="${IOTDB_HOME}/.."
 eval set -- "$VARS"
 
 if [ -n "$JAVA_HOME" ]; then
diff --git a/server/src/assembly/resources/tools/tsfileToolSet/validate-tsfile.sh b/server/src/assembly/resources/tools/tsfileToolSet/validate-tsfile.sh
index dd52d2a4f9..f02121a573 100644
--- a/server/src/assembly/resources/tools/tsfileToolSet/validate-tsfile.sh
+++ b/server/src/assembly/resources/tools/tsfileToolSet/validate-tsfile.sh
@@ -22,10 +22,11 @@ echo ---------------------
 echo Starting Validating the TsFile
 echo ---------------------
 
-source "$(dirname "$0")/iotdb-common.sh"
+source "$(dirname "$0")/../../sbin/iotdb-common.sh"
 #get_iotdb_include and checkAllVariables is in iotdb-common.sh
 VARS=$(get_iotdb_include "$*")
 checkAllVariables
+export IOTDB_HOME="${IOTDB_HOME}/.."
 eval set -- "$VARS"
 
 if [ -n "$JAVA_HOME" ]; then