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

[iotdb] branch master updated: [IOTDB-5013] Added simple standalone logic for starting and stopping shells (#8152)

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

caogaofei 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 f7faed2b9b [IOTDB-5013] Added simple standalone logic for starting and stopping shells (#8152)
f7faed2b9b is described below

commit f7faed2b9b463f287950f64759e85e350b5ee2b6
Author: Caideyipi <87...@users.noreply.github.com>
AuthorDate: Sat Nov 26 22:30:18 2022 +0800

    [IOTDB-5013] Added simple standalone logic for starting and stopping shells (#8152)
---
 docs/UserGuide/Cluster/Cluster-Concept.md          |  2 +-
 docs/UserGuide/Cluster/Cluster-Setup.md            | 68 +++++++++++++++++++---
 docs/UserGuide/QuickStart/QuickStart.md            | 49 +++++-----------
 docs/zh/UserGuide/Cluster/Cluster-Concept.md       |  2 +-
 docs/zh/UserGuide/Cluster/Cluster-Setup.md         | 59 +++++++++++++++++--
 docs/zh/UserGuide/QuickStart/QuickStart.md         | 38 ++++--------
 .../src/assembly/resources/sbin/iotdb-common.sh    |  2 +-
 .../assembly/resources/sbin/start-standalone.bat   | 42 +++++++++++++
 .../assembly/resources/sbin/start-standalone.sh    | 43 ++++++++++++++
 .../assembly/resources/sbin/stop-standalone.bat    | 40 +++++++++++++
 .../src/assembly/resources/sbin/stop-standalone.sh | 40 +++++++++++++
 11 files changed, 309 insertions(+), 76 deletions(-)

diff --git a/docs/UserGuide/Cluster/Cluster-Concept.md b/docs/UserGuide/Cluster/Cluster-Concept.md
index 39d3865c8d..1db63ef538 100644
--- a/docs/UserGuide/Cluster/Cluster-Concept.md
+++ b/docs/UserGuide/Cluster/Cluster-Concept.md
@@ -109,4 +109,4 @@ Among multiple Regions of each RegionGroup, consistency is guaranteed through a
 * Current supported consensus protocol
   * SimpleConsensus:Provide strong consistency, could only be used when replica is 1, which is the empty implementation of the consensus protocol.
   * IoTConsensus:Provide eventual consistency, could be used in any number of replicas, 2 replicas could avoid single point failure, only for DataRegion, writings can be applied on each replica and replicated asynchronously to other replicas.
-  * RatisConsensus:Provide Strong consistency, using raft consensus protocol, Could be used in any number of replicas, and could be used for any region groups。
\ No newline at end of file
+  * RatisConsensus:Provide Strong consistency, using raft consensus protocol, Could be used in any number of replicas, and could be used for any region groups。
diff --git a/docs/UserGuide/Cluster/Cluster-Setup.md b/docs/UserGuide/Cluster/Cluster-Setup.md
index edeece8026..993a5fc4d3 100644
--- a/docs/UserGuide/Cluster/Cluster-Setup.md
+++ b/docs/UserGuide/Cluster/Cluster-Setup.md
@@ -94,7 +94,7 @@ iotdb-confignode.properties:
 | cn\_internal\_address          | Internal rpc service address of ConfigNode                                                   |
 | cn\_internal\_port             | Internal rpc service port of ConfigNode                                                      |
 | cn\_consensus\_port            | ConfigNode replication consensus protocol communication port                                 |
-| cn\_target\_config\_node\_list | Target ConfigNode address, if the current is the first ConfigNode, then set its address:port |
+| cn\_target\_config\_node\_list | Target ConfigNode address, if the current ConfigNode is the first one, then set its own address:port |
 
 iotdb-common.properties:
 
@@ -108,10 +108,10 @@ iotdb-common.properties:
 Start on Linux:
 ```
 # Foreground
-./sbin/start-confignode.sh
+bash ./sbin/start-confignode.sh
 
 # Background
-nohup ./sbin/start-confignode.sh >/dev/null 2>&1 &
+nohup bash ./sbin/start-confignode.sh >/dev/null 2>&1 &
 ```
 
 Start on Windows:
@@ -147,10 +147,10 @@ Please set the important parameters in iotdb-datanode.properties:
 Start on Linux:
 ```
 # Foreground
-./sbin/start-datanode.sh
+bash ./sbin/start-datanode.sh
 
 # Background
-nohup ./sbin/start-datanode.sh >/dev/null 2>&1 &
+nohup bash ./sbin/start-datanode.sh >/dev/null 2>&1 &
 ```
 
 Start on Windows:
@@ -158,9 +158,63 @@ Start on Windows:
 sbin\start-datanode.bat
 ```
 
-More details [DataNode Configurations](https://iotdb.apache.org/UserGuide/Master/Reference/DataNode-Config-Manual.html).
+More details are in [DataNode Configurations](https://iotdb.apache.org/UserGuide/Master/Reference/DataNode-Config-Manual.html).
 
-### Start Cli
+### Stop IoTDB
+When you meet problem, and want to stop IoTDB ConfigNode and DataNode directly, our shells can help you do this.
+
+In Windows:
+
+```
+sbin\stop-datanode.bat
+```
+```
+sbin\stop-confignode.bat
+```
+In Linux:
+```
+bash sbin/stop-datanode.sh
+```
+```
+bash sbin/stop-confignode.sh
+```
+Be careful not to miss the "sudo" label, because some port info's acquisition may require root authority. If you can't sudo, just
+use "jps" or "ps aux | grep iotdb" to get the process's id, then use "kill -9 <process-id>" to stop the process.  
+
+## Start StandAlone
+If you just want to setup your IoTDB locally, 
+You can quickly init 1C1D (i.e. 1 Confignode and 1 Datanode) environment by our shells.
+
+This will work well if you don't change our default settings.
+
+Start on Windows:
+```
+sbin\start-standalone.bat
+```
+Start on Linux:
+```
+bash sbin/start-standalone.sh
+```
+It's recommended to use sudo here, for that the backstage logs may need sudo permission.
+
+Besides, with our shell, you can also directly kill these processes.
+
+Stop on Windows:
+```
+sbin\stop-standalone.bat
+```
+Stop on Linux:
+```
+bash sbin/stop-standalone.sh
+```
+
+Note: On Linux, the 1C1D processes both launches in the background, and you can see the logs for details. 
+
+The stop-standalone.sh may not work well without sudo, since IoTDB's port numbers may be invisible without permission. 
+If stop-standalone.sh meets some error, you can use "jps" or "ps aux | grep iotdb" to obtain the process ids,
+and use "sudo kill -9 <process-id>" to manually stop the processes.
+
+## Start Cli
 
 Cli shell is in sbin folder.
 
diff --git a/docs/UserGuide/QuickStart/QuickStart.md b/docs/UserGuide/QuickStart/QuickStart.md
index f101302840..d48a0afe76 100644
--- a/docs/UserGuide/QuickStart/QuickStart.md
+++ b/docs/UserGuide/QuickStart/QuickStart.md
@@ -59,47 +59,23 @@ For more, see [Config](../Reference/DataNode-Config-Manual.md) in detail.
 You can go through the following step to test the installation, if there is no error after execution, the installation is completed. 
 
 ### Start IoTDB
+IoTDB is a database based on distributed system. To launch IoTDB, you can first start standalone mode (i.e. 1 ConfigNode and 1 DataNode) to check.
 
-Users can start IoTDB by the start-server script under the sbin folder.
+Users can start IoTDB standalone mode by the start-standalone script under the sbin folder.
 
 ```
 # Unix/OS X
-> nohup sbin/start-server.sh -b
+> bash sbin/start-standalone.sh
 ```
-or
-```shell
-> nohup sbin/start-server.sh >/dev/null 2>&1 &
-```
-
-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)
-- "-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 
-- "-g": print the GC log
-- "-c \<config folder\>": set IOTDB_CONF parameter
-- "-D <a=b>": set system variables to IoTDB program.
-- "-H \<filePath\> save heap dump file to \<filePath\> (only works when iotdb memory <16GB)"
-- "-E <\filePath\> save error file of JVM to \<filePath\>"
-- "-X \<command\> equal to -XX:\<command\>"
+It's recommended to use sudo here, because you may need root permission to write backstage logs.
 
 ```
 # Windows
-> sbin\start-server.bat -c <conf_path>
+> sbin\start-standalone.bat
 ```
 
-Notice that Windows OS only support -v, -c, -f and -b.
-if you want to use JMX to connect IOTDB, you may need to add/modify 
-
-```
--Dcom.sun.management.jmxremote.rmi.port=<PORT> -Djava.rmi.server.hostname=<IP> 
-```
-to $IOTDB_JMX_OPTS in datanode-env.sh. or datanode-env.bat
-
-
+Note: Currently, To run standalone mode, you need to ensure that all addresses are set to 127.0.0.1, and replication factors set to 1, which is by now the default setting.
+Besides, it's recommended to use SimpleConsensus in this mode, since it brings additional efficiency.
 ### Use Cli
 
 IoTDB offers different ways to interact with server, here we introduce basic steps of using Cli tool to insert and query data.
@@ -112,7 +88,7 @@ Here is the command for starting the Cli:
 
 ```
 # Unix/OS X
-> sbin/start-cli.sh -h 127.0.0.1 -p 6667 -u root -pw root
+> bash sbin/start-cli.sh -h 127.0.0.1 -p 6667 -u root -pw root
 
 # Windows
 > sbin\start-cli.bat -h 127.0.0.1 -p 6667 -u root -pw root
@@ -129,7 +105,7 @@ The command line client is interactive so if everything is ready you should see
 |_____|'.__.' |_____|  |______.'|_______/  version x.x.x
 
 
-IoTDB> login successfully
+Successfully login at 127.0.0.1:6667
 IoTDB>
 ```
 
@@ -238,12 +214,13 @@ The server can be stopped with ctrl-C or the following script:
 
 ```
 # Unix/OS X
-> sbin/stop-server.sh
+> bash sbin/stop-standalone.sh
 
 # Windows
-> sbin\stop-server.bat
+> sbin\stop-standalone.bat
 ```
-
+Note: In Linux, please add the "sudo" as far as possible, or else the stopping process may fail.
+More explanations are in Cluster/Cluster-setup.md.
 
 ## Basic configuration
 
diff --git a/docs/zh/UserGuide/Cluster/Cluster-Concept.md b/docs/zh/UserGuide/Cluster/Cluster-Concept.md
index 9e781fb7d9..238e471915 100644
--- a/docs/zh/UserGuide/Cluster/Cluster-Concept.md
+++ b/docs/zh/UserGuide/Cluster/Cluster-Concept.md
@@ -111,4 +111,4 @@ Region 是数据复制的基本单位,一个 Region 的多个副本构成了
 * 现有的共识协议
     * SimpleConsensus:提供强一致性,仅单副本时可用,一致性协议的极简实现,效率最高。
     * IoTConsensus:提供最终一致性,任意副本数可用,2 副本时可容忍 1 节点失效,当前仅可用于 DataRegion 的副本上,写入可以在任一副本进行,并异步复制到其他副本。
-    * RatisConsensus:提供强一致性,Raft 协议的一种实现,任意副本数可用,当前可用于任意副本组上。
\ No newline at end of file
+    * RatisConsensus:提供强一致性,Raft 协议的一种实现,任意副本数可用,当前可用于任意副本组上。
diff --git a/docs/zh/UserGuide/Cluster/Cluster-Setup.md b/docs/zh/UserGuide/Cluster/Cluster-Setup.md
index c83421ec4b..03fae69b3f 100644
--- a/docs/zh/UserGuide/Cluster/Cluster-Setup.md
+++ b/docs/zh/UserGuide/Cluster/Cluster-Setup.md
@@ -107,10 +107,10 @@ iotdb-common.properties:
 Linux 启动方式:
 ```
 # 前台启动
-./sbin/start-confignode.sh
+bash ./sbin/start-confignode.sh
 
 # 后台启动
-nohup ./sbin/start-confignode.sh >/dev/null 2>&1 &
+nohup bash ./sbin/start-confignode.sh >/dev/null 2>&1 &
 ```
 
 Windows 启动方式:
@@ -147,10 +147,10 @@ iotdb-datanode.properties 中的重要配置如下:
 Linux 启动方式:
 ```
 # 前台启动
-./sbin/start-datanode.sh
+bash ./sbin/start-datanode.sh
 
 # 后台启动
-nohup ./sbin/start-datanode.sh >/dev/null 2>&1 &
+nohup bash ./sbin/start-datanode.sh >/dev/null 2>&1 &
 ```
 
 Windows 启动方式:
@@ -160,6 +160,57 @@ sbin\start-datanode.bat
 
 具体参考 [DataNode配置参数](https://iotdb.apache.org/zh/UserGuide/Master/Reference/DataNode-Config-Manual.html)。
 
+### 停止 IoTDB 进程
+如果你碰到了问题,希望手动关闭 IoTDB 的 ConfigNode 和 DataNode 进程,可以使用我们的脚本。
+
+在 Windows 上:
+
+```
+sbin\stop-datanode.bat
+```
+```
+sbin\stop-confignode.bat
+```
+在 Linux 上:
+```
+bash sbin/stop-datanode.sh
+```
+```
+bash sbin/stop-confignode.sh
+```
+
+注意不要遗漏 ”sudo“ 的标签,因为一些端口信息的获取需要 root 权限。如果无法 sudo 或遇到其他问题,可以使用 jps 或 ps aux | grep iotdb 的命令来获取 IoTDB 的进程,然后使用 kill -9 进程号来结束此进程。
+
+## 启动单机
+除了集群之外, 我们的脚本也提供了单机 1C1D(也就是1个Confignode + 1个Datanode) 的便捷启动方式。
+
+在不更改配置文件的情况下,该脚本可以成功执行。
+
+Windows 启动方式:
+```
+sbin\start-standalone.bat
+```
+Linux 启动方式:
+```
+bash sbin/start-standalone.sh
+```
+这里建议使用 sudo,因为后台日志的写入可能需要 root 权限。
+
+也可以使用脚本直接关闭这些进程。
+
+Windows 停止方式:
+```
+sbin\stop-standalone.bat
+```
+Linux 停止方式:
+```
+bash sbin/stop-standalone.sh
+```
+注意: 在 Linux 平台上,1C1D 的两个进程都在后台启动,可以查看 confignode1.log 和 datanode1.log 来找到它们的运行日志。
+
+一般来说,stop-standalone.sh需要sudo权限,因为iotdb的端口信息在非sudo下可能是隐形的。如果 stop-standalone.sh
+出现错误,可以使用“jps”命令或“ps aux | grep iotdb“命令来查看iotdb的进程,再使用" kill -9 <进程号>"的方式来停止它们。
+
 ### 启动 Cli
 
 Cli 启动脚本在 sbin 目录。
diff --git a/docs/zh/UserGuide/QuickStart/QuickStart.md b/docs/zh/UserGuide/QuickStart/QuickStart.md
index 2d28f7f0f8..025e37ffb0 100644
--- a/docs/zh/UserGuide/QuickStart/QuickStart.md
+++ b/docs/zh/UserGuide/QuickStart/QuickStart.md
@@ -51,39 +51,24 @@ IoTDB 支持多种安装途径。用户可以使用三种方式对 IoTDB 进行
 用户可以根据以下操作对 IoTDB 进行简单的试用,若以下操作均无误,则说明 IoTDB 安装成功。
 
 ### 启动 IoTDB
+IoTDB 是一个基于分布式系统的数据库。要启动 IoTDB ,你可以先启动单机版(一个 ConfigNode 和一个 DataNode)来检查安装。
 
-用户可以使用 sbin 文件夹下的 start-server 脚本启动 IoTDB。
+用户可以使用 sbin 文件夹下的 start-standalone 脚本启动 IoTDB。
 
 Linux 系统与 MacOS 系统启动命令如下:
 
 ```
-> nohup sbin/start-server.sh -f >/dev/null 2>&1 &
-or
-> nohup sbin/start-server.sh -d
-```
-可选参数:
-- 默认不含任何参数时, iotdb 将在后台启动,并且不在控制台打印日志
-- "-v": 查看iotdb版本
-- "-f": 在控制台前台启动iotdb (v0.14前是默认设置)
-- "-d": 在后台启动iotdb,控制台不打印日志
-- "-p \<pidfile\>": 将pid保存到指定的文件中
-- "-h": 查看帮助
-- "printgc"(必须是最后一个参数): 打印GC日志 (从v0.14起,该参数将被-g取代)
-- "-g": 打印GC日志
-- "-c \<config folder\>": 设置IOTDB_CONF变量的值,从而修改配置文件所在文件夹
-- "-D <a=b>": 设置Java的系统环境变量或其他参数
-- "-H \<filePath\> 当OOM异常时存储堆快照到\<filePath\> (仅 Linux/Mac生效, 且要求iotdb内存小于16GB)"
-- "-E <\filePath\> save error file of JVM to \<filePath\> (仅 Linux/Mac生效)"
-- "-X \<command\> 等价于JVM中 -XX:\<command\>"
+> bash sbin/start-standalone.sh
+```
+这里最好使用sudo,如果不使用 sudo,可能会提示后台日志无权限写入。
 
 Windows 系统启动命令如下:
 
 ```
-> sbin\start-server.bat -c <conf_path>
+> sbin\start-standalone.bat
 ```
-- "-c"是可选的。
-- 选项 "-c" 指定了配置文件所在的文件夹。
 
+注意:目前,要使用单机模式,你需要保证所有的地址设置为 127.0.0.1,副本数设置为1。并且,推荐使用 SimpleConsensus,因为这会带来额外的效率。这些现在都是默认配置。
 ### 使用 Cli 工具
 
 IoTDB 为用户提供多种与服务器交互的方式,在此我们介绍使用 Cli 工具进行写入、查询数据的基本步骤。
@@ -95,7 +80,7 @@ IoTDB 为用户提供多种与服务器交互的方式,在此我们介绍使
 Linux 系统与 MacOS 系统启动命令如下:
 
 ```
-> sbin/start-cli.sh -h 127.0.0.1 -p 6667 -u root -pw root
+> bash sbin/start-cli.sh -h 127.0.0.1 -p 6667 -u root -pw root
 ```
 
 Windows 系统启动命令如下:
@@ -114,7 +99,7 @@ Windows 系统启动命令如下:
  _| |_| \__. | _| |_    _| |_.' /_| |__) |
 |_____|'.__.' |_____|  |______.'|_______/  version x.x.x
 
-IoTDB> login successfully
+Successfully login at 127.0.0.1:6667
 IoTDB>
 ```
 
@@ -257,14 +242,15 @@ IoTDB> exit
 Linux 系统与 MacOS 系统停止命令如下:
 
 ```
-> sbin/stop-server.sh
+> sudo bash sbin/stop-standalone.sh
 ```
 
 Windows 系统停止命令如下:
 
 ```
-> sbin\stop-server.bat
+> sbin\stop-standalone.bat
 ```
+注意:在 Linux 下,执行停止脚本时,请尽量加上 sudo 语句,不然停止可能会失败。更多的解释在分布式/分布式部署中。
 
 ## 基础配置
 
diff --git a/node-commons/src/assembly/resources/sbin/iotdb-common.sh b/node-commons/src/assembly/resources/sbin/iotdb-common.sh
index fcdcc64a02..822c326e84 100755
--- a/node-commons/src/assembly/resources/sbin/iotdb-common.sh
+++ b/node-commons/src/assembly/resources/sbin/iotdb-common.sh
@@ -164,7 +164,7 @@ initEnv() {
         . "${IOTDB_HOME}/conf/datanode-env.sh"
       fi
   else
-      echo "can't find $IOTDB_CONF/datanode-env.sh"
+      echo "Can't find $IOTDB_CONF/datanode-env.sh"
   fi
 }
 
diff --git a/node-commons/src/assembly/resources/sbin/start-standalone.bat b/node-commons/src/assembly/resources/sbin/start-standalone.bat
new file mode 100644
index 0000000000..9eed454fe3
--- /dev/null
+++ b/node-commons/src/assembly/resources/sbin/start-standalone.bat
@@ -0,0 +1,42 @@
+@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
+
+pushd %~dp0..
+if NOT DEFINED IOTDB_HOME set IOTDB_HOME=%cd%
+popd
+
+IF EXIST "%IOTDB_HOME%\sbin\start-confignode.bat" (
+  SET CONFIGNODE_START_PATH=%IOTDB_HOME%\sbin\start-confignode.bat
+) ELSE (
+  echo "Can't find start-confignode.bat."
+  exit 0
+)
+
+IF EXIST "%IOTDB_HOME%\sbin\start-datanode.bat" (
+  SET DATANODE_START_PATH=%IOTDB_HOME%\sbin\start-datanode.bat
+) ELSE (
+  echo "Can't find start-datanode.bat."
+  exit 0
+)
+
+start cmd /c %CONFIGNODE_START_PATH%
+TIMEOUT /T 5 /NOBREAK
+start cmd /c %DATANODE_START_PATH%
+
+echo "Execute start-standalone.sh finished, you can see more details in the logs of confignode and datanode"
diff --git a/node-commons/src/assembly/resources/sbin/start-standalone.sh b/node-commons/src/assembly/resources/sbin/start-standalone.sh
new file mode 100644
index 0000000000..eb1e10a241
--- /dev/null
+++ b/node-commons/src/assembly/resources/sbin/start-standalone.sh
@@ -0,0 +1,43 @@
+#!/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.
+#
+
+if [ -z "${IOTDB_HOME}" ]; then
+  export IOTDB_HOME="`dirname "$0"`/.."
+fi
+
+if [ -f "$IOTDB_HOME/sbin/start-confignode.sh" ]; then
+  export CONFIGNODE_START_PATH="$IOTDB_HOME/sbin/start-confignode.sh"
+else
+  echo "Can't find start-confignode.sh"
+  exit 0
+fi
+
+if [ -f "$IOTDB_HOME/sbin/start-datanode.sh" ]; then
+  export DATANODE_START_PATH="$IOTDB_HOME/sbin/start-datanode.sh"
+else
+  echo "Can't find start-datanode.sh"
+  exit 0
+fi
+
+nohup bash "$CONFIGNODE_START_PATH" >/dev/null 2>&1 &
+sleep 5
+nohup bash "$DATANODE_START_PATH" >/dev/null 2>&1 &
+
+echo "Execute start-standalone.sh finished, you can see more details in the logs of confignode and datanode"
diff --git a/node-commons/src/assembly/resources/sbin/stop-standalone.bat b/node-commons/src/assembly/resources/sbin/stop-standalone.bat
new file mode 100644
index 0000000000..3eedb9ca5d
--- /dev/null
+++ b/node-commons/src/assembly/resources/sbin/stop-standalone.bat
@@ -0,0 +1,40 @@
+@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
+
+pushd %~dp0..
+if NOT DEFINED IOTDB_HOME set IOTDB_HOME=%cd%
+popd
+
+IF EXIST "%IOTDB_HOME%\sbin\stop-confignode.bat" (
+  SET CONFIGNODE_STOP_PATH=%IOTDB_HOME%\sbin\stop-confignode.bat
+) ELSE (
+  echo "Can't find stop-confignode.bat."
+  exit 0
+)
+
+IF EXIST "%IOTDB_HOME%\sbin\stop-datanode.bat" (
+  SET DATANODE_STOP_PATH=%IOTDB_HOME%\sbin\stop-datanode.bat
+) ELSE (
+  echo "Can't find stop-datanode.bat."
+  exit 0
+)
+
+start cmd /c %CONFIGNODE_STOP_PATH%
+TIMEOUT /T 5 /NOBREAK
+start cmd /c %DATANODE_STOP_PATH%
\ No newline at end of file
diff --git a/node-commons/src/assembly/resources/sbin/stop-standalone.sh b/node-commons/src/assembly/resources/sbin/stop-standalone.sh
new file mode 100644
index 0000000000..1bcb7626e6
--- /dev/null
+++ b/node-commons/src/assembly/resources/sbin/stop-standalone.sh
@@ -0,0 +1,40 @@
+#!/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.
+#
+
+if [ -z "${IOTDB_HOME}" ]; then
+  export IOTDB_HOME="`dirname "$0"`/.."
+fi
+
+if [ -f "$IOTDB_HOME/sbin/stop-confignode.sh" ]; then
+  export CONFIGNODE_STOP_PATH="$IOTDB_HOME/sbin/stop-confignode.sh"
+else
+  echo "Can't find stop-confignode.sh"
+  exit 0
+fi
+
+if [ -f "$IOTDB_HOME/sbin/stop-datanode.sh" ]; then
+  export DATANODE_STOP_PATH="$IOTDB_HOME/sbin/stop-datanode.sh"
+else
+  echo "Can't find stop-datanode.sh"
+  exit 0
+fi
+
+bash "$CONFIGNODE_STOP_PATH"
+bash "$DATANODE_STOP_PATH"