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 11:10:32 UTC

[iotdb] branch master updated: [IOTDB-5006]Add a load-tsfile script (#8120)

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 3103c12a00 [IOTDB-5006]Add a load-tsfile script  (#8120)
3103c12a00 is described below

commit 3103c12a007b854c5f2e4dbd2759eb2fb9d037f1
Author: yschengzi <87...@users.noreply.github.com>
AuthorDate: Thu Nov 24 19:10:27 2022 +0800

    [IOTDB-5006]Add a load-tsfile script  (#8120)
---
 cli/src/assembly/resources/tools/load-tsfile.bat   | 107 +++++++++++++++++
 cli/src/assembly/resources/tools/load-tsfile.sh    | 132 +++++++++++++++++++++
 .../Load-Tsfile.md}                                |  41 +++++--
 .../Maintenance-Tools/Rewrite-TsFile-Tool.md       |  62 ----------
 docs/UserGuide/Write-Data/Batch-Load-Tool.md       |   2 +-
 .../Load-Tsfile.md}                                |  41 +++++--
 .../Maintenance-Tools/Rewrite-TsFile-Tool.md       |  62 ----------
 docs/zh/UserGuide/Write-Data/Batch-Load-Tool.md    |   2 +-
 site/src/main/.vuepress/config.js                  |   8 +-
 9 files changed, 303 insertions(+), 154 deletions(-)

diff --git a/cli/src/assembly/resources/tools/load-tsfile.bat b/cli/src/assembly/resources/tools/load-tsfile.bat
new file mode 100644
index 0000000000..a3c9d2e680
--- /dev/null
+++ b/cli/src/assembly/resources/tools/load-tsfile.bat
@@ -0,0 +1,107 @@
+@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
+
+@REM You can put your env variable here
+@REM set JAVA_HOME=%JAVA_HOME%
+
+if "%OS%" == "Windows_NT" setlocal
+
+pushd %~dp0..
+if NOT DEFINED IOTDB_HOME set IOTDB_HOME=%CD%
+popd
+
+if NOT DEFINED MAIN_CLASS set MAIN_CLASS=org.apache.iotdb.cli.Cli
+if NOT DEFINED JAVA_HOME goto :err
+
+@REM -----------------------------------------------------------------------------
+@REM JVM Opts we'll use in legacy run or installation
+set JAVA_OPTS=-ea^
+ -DIOTDB_HOME="%IOTDB_HOME%"
+
+REM For each jar in the IOTDB_HOME lib directory call append to build the CLASSPATH variable.
+if EXIST %IOTDB_HOME%\lib (set CLASSPATH="%IOTDB_HOME%\lib\*") else set CLASSPATH="%IOTDB_HOME%\..\lib\*"
+
+REM -----------------------------------------------------------------------------
+
+@REM set default parameters
+set pw_parameter=-pw root
+set u_parameter=-u root
+set p_parameter=-p 6667
+set h_parameter=-h 127.0.0.1
+set load_dir_parameter=-e "load '
+set sg_level_parameter=
+set verify_parameter=
+set on_success_parameter=
+
+echo %* | findstr /c:"-f">nul || (goto :load_err)
+
+@Rem get every param of input
+:loop
+set param=%1
+if %param%!== ! (
+	goto :finally
+) else if "%param%"=="-pw" (
+	set pw_parameter=%1 %2
+) else if "%param%"=="-u" (
+	set u_parameter=%1 %2
+) else if "%param%"=="-p" (
+	set p_parameter=%1 %2
+) else if "%param%"=="-h" (
+	set h_parameter=%1 %2
+) else if "%param%"=="-f" (
+	if "%2"=="" goto :load_err
+	set load_dir_parameter=%load_dir_parameter%%2'
+) else if "%param%"=="--sgLevel" (
+	set sg_level_parameter=sgLevel=%2
+) else if "%param%"=="--verify" (
+	set verify_parameter=verify=%2
+) else if "%param%"=="--onSuccess" (
+	set on_success_parameter=onSuccess=%2
+)
+shift
+goto :loop
+
+
+:err
+echo JAVA_HOME environment variable must be set!
+set ret_code=1
+ENDLOCAL
+EXIT /B %ret_code%
+
+:load_err
+echo -f option must be set!
+set ret_code=1
+ENDLOCAL
+EXIT /B %ret_code%
+
+@REM -----------------------------------------------------------------------------
+:finally
+
+set PARAMETERS=%h_parameter% %p_parameter% %u_parameter% %pw_parameter% %load_dir_parameter% %sg_level_parameter% %verify_parameter% %on_success_parameter%"
+echo %PARAMETERS%
+
+echo start loading TsFiles, please wait...
+"%JAVA_HOME%\bin\java" %JAVA_OPTS% -cp %CLASSPATH% %MAIN_CLASS% %PARAMETERS%
+set ret_code=%ERRORLEVEL%
+
+ENDLOCAL
+
+EXIT /B %ret_code%
diff --git a/cli/src/assembly/resources/tools/load-tsfile.sh b/cli/src/assembly/resources/tools/load-tsfile.sh
new file mode 100644
index 0000000000..27facd0224
--- /dev/null
+++ b/cli/src/assembly/resources/tools/load-tsfile.sh
@@ -0,0 +1,132 @@
+#!/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.
+#
+
+echo ---------------------
+echo Start Loading TsFile
+echo ---------------------
+
+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"
+
+PARAMETERS=""
+HELP="Usage: $0 -f <file_path> [--sgLevel <sg_level>] [--verify <true/false>] [--onSuccess <none/delete>] [-h <ip>] [-p <port>] [-u <username>] [-pw <password>]"
+
+# Added parameters when default parameters are missing
+user_param="-u root"
+passwd_param="-pw root"
+host_param="-h 127.0.0.1"
+port_param="-p 6667"
+
+while true; do
+    case "$1" in
+        -u)
+            user_param="-u $2"
+            shift 2
+            ;;
+        -pw)
+            passwd_param="-pw $2"
+            shift 2
+        ;;
+        -h)
+            host_param="-h $2"
+            shift 2
+        ;;
+        -p)
+            port_param="-p $2"
+            shift 2
+        ;;
+        -f)
+            load_dir_param="$2"
+            shift 2
+        ;;
+        --sgLevel)
+            sg_level_param="$2"
+            shift 2
+        ;;
+        --verify)
+            verify_param="$2"
+            shift 2
+        ;;
+        --onSuccess)
+            on_success_param="$2"
+            shift 2
+        ;;
+        "")
+              #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
+              break
+              ;;
+        *)
+            echo "Unrecognized options:$1"
+            echo "${HELP}"
+            exit 0
+        ;;
+    esac
+done
+
+if [ -z "${load_dir_param}" ]; then
+    echo "A Loading file path/directory path is required."
+    echo "${HELP}"
+fi
+
+LOAD_SQL="load '${load_dir_param}'"
+if [ -n "${sg_level_param}" ]; then
+    LOAD_SQL="${LOAD_SQL} sgLevel=${sg_level_param}"
+fi
+if [ -n "${verify_param}" ]; then
+    LOAD_SQL="${LOAD_SQL} verify=${verify_param}"
+fi
+if [ -n "${on_success_param}" ]; then
+    LOAD_SQL="${LOAD_SQL} onSuccess=${on_success_param}"
+fi
+
+PARAMETERS="$host_param $port_param $user_param $passwd_param $PARAMETERS -e \"${LOAD_SQL}\""
+
+IOTDB_CLI_CONF=${IOTDB_HOME}/conf
+
+MAIN_CLASS=org.apache.iotdb.cli.Cli
+
+CLASSPATH=""
+for f in ${IOTDB_HOME}/lib/*.jar; do
+  CLASSPATH=${CLASSPATH}":"$f
+done
+
+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
+
+set -o noglob
+iotdb_cli_params="-Dlogback.configurationFile=${IOTDB_CLI_CONF}/logback-cli.xml"
+
+echo "start loading TsFiles, please wait..."
+exec "$JAVA" $iotdb_cli_params -cp "$CLASSPATH" "$MAIN_CLASS" $PARAMETERS
+
+exit $?
diff --git a/docs/UserGuide/Write-Data/Load-External-Tsfile.md b/docs/UserGuide/Maintenance-Tools/Load-Tsfile.md
similarity index 66%
rename from docs/UserGuide/Write-Data/Load-External-Tsfile.md
rename to docs/UserGuide/Maintenance-Tools/Load-Tsfile.md
index 62876f1fb2..112b42aba5 100644
--- a/docs/UserGuide/Write-Data/Load-External-Tsfile.md
+++ b/docs/UserGuide/Maintenance-Tools/Load-Tsfile.md
@@ -23,9 +23,9 @@
 
 ## Introduction
 
-The load external tsfile tool allows users to load tsfiles, delete a tsfile, or move a tsfile to target directory from the running Apache IoTDB instance.
+The load external tsfile tool allows users to load tsfiles, delete a tsfile, or move a tsfile to target directory from the running Apache IoTDB instance. Alternatively, you can use scripts to load tsfiles into IoTDB, for more information.
 
-## Usage
+## Load with SQL
 
 The user sends specified commands to the Apache IoTDB system through the Cli tool or JDBC to use the tool.
 
@@ -73,22 +73,39 @@ Examples:
 
 **NOTICE**:  When `$IOTDB_HOME$/conf/iotdb-datanode.properties` has `enable_auto_create_schema=true`, it will automatically create metadata in TSFILE, otherwise it will not be created automatically. 
 
-### remove a tsfile
+## Load with Script
 
-The command to delete a tsfile is: `remove '<path>'`.
+Run rewrite-tsfile.bat if you are in a Windows environment, or rewrite-tsfile.sh if you are on Linux or Unix.
 
-This command deletes a tsfile by specifying the file path. The specific implementation is to delete the tsfile and its corresponding `.resource` and` .modification` files.
+```bash
+./load-tsfile.bat -f filePath [-h host] [-p port] [-u username] [-pw password] [--sgLevel int] [--verify true/false] [--onSuccess none/delete]
+-f 			File/Directory to be load, required
+-h 			IoTDB Host address, optional field, 127.0.0.1 by default
+-p 			IoTDB port, optional field, 6667 by default
+-u 			IoTDB user name, optional field, root by default
+-pw 		IoTDB password, optional field, root by default
+--sgLevel 	Sg level of loading Tsfile, optional field, default_storage_group_level in 				iotdb-common.properties by default
+--verify 	Verify schema or not, optional field, True by default
+--onSuccess Delete or remain origin TsFile after loading, optional field, none by default
+```
 
-Examples:
+### Example
 
-* `remove '/Users/Desktop/data/data/root.vehicle/0/0/1575028885956-101-0.tsfile'`
+Assuming that an IoTDB instance is running on server 192.168.0.101:6667, you want to load all TsFile files from the locally saved TsFile backup folder D:\IoTDB\data into this IoTDB instance.
 
-### unload a tsfile and move it to a target directory
+First move to the folder `$IOTDB_HOME/tools/`, open the command line, and execute
 
-The command to unload a tsfile and move it to target directory is: `unload '<path>' '<dir>'`.
+```bash
+./load-rewrite.bat -f D:\IoTDB\data -h 192.168.0.101 -p 6667 -u root -pw root
+```
 
-This command unload a tsfile and move it to a target directory by specifying tsfile path and the target directory(absolute path). The specific implementation is to remove the tsfile from the engine and move the tsfile file and its corresponding `.resource` file to the target directory.
+After waiting for the script execution to complete, you can check that the data in the IoTDB instance has been loaded correctly.
 
-Examples:
+### Q&A
 
-* `unload '/Users/Desktop/data/data/root.vehicle/0/0/1575028885956-101-0.tsfile' '/data/data/tmp'`
\ No newline at end of file
+- Cannot find or load the main class
+  - It may be because the environment variable $IOTDB_HOME is not set, please set the environment variable and try again
+- -f option must be set!
+  - The input command is missing the -f field (file or folder path to be loaded) or the -u field (user name), please add it and re-execute
+- What if the execution crashes in the middle and you want to reload?
+  - You re-execute the command just now, reloading the data will not affect the correctness after loading
\ No newline at end of file
diff --git a/docs/UserGuide/Maintenance-Tools/Rewrite-TsFile-Tool.md b/docs/UserGuide/Maintenance-Tools/Rewrite-TsFile-Tool.md
deleted file mode 100644
index e67ee74cd2..0000000000
--- a/docs/UserGuide/Maintenance-Tools/Rewrite-TsFile-Tool.md
+++ /dev/null
@@ -1,62 +0,0 @@
-<!--
-
-    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 Rewrite-TsFile Tool
-
-## Introduction
-
-The Rewrite-TsFile tool is used to write the data in TsFile to the running IoTDB.
-
-## How to use
-
-Run rewrite-tsfile.bat if you are in a Windows environment, or rewrite-tsfile.sh if you are on Linux or Unix.
-
-```bash
-./rewrite-tsfile.bat -f filePath [-h host] [-help] [-p port] [-pw password] -u user
--f File or Dictionary to be loaded.
--h Host Name (optional, default 127.0.0.1)
--help Display help information(optional)
--p Port (optional, default 6667)
--pw password (optional)
--u User name (required)
-```
-
-## Example
-
-Assuming that an IoTDB instance is running on server 192.168.0.101:6667, you want to load all TsFile files from the locally saved TsFile backup folder D:\IoTDB\data into this IoTDB instance.
-
-First move to the folder where rewrite-tsfile.bat is located, open the command line, and execute
-
-```bash
-./load-rewrite.bat -f "D:\IoTDB\data" -h 192.168.0.101 -p 6667 -u root -pw root
-```
-
-After waiting for the script execution to complete, you can check that the data in the IoTDB instance has been loaded correctly.
-
-## Q&A
-
-- Cannot find or load the main class RewriteTsFileTool
-  - It may be because the environment variable $IOTDB_HOME is not set, please set the environment variable and try again
-- Missing require argument: f or Missing require argument: u
-  - The input command is missing the -f field (file or folder path to be loaded) or the -u field (user name), please add it and re-execute
-- What if the execution crashes in the middle and you want to reload?
-  - The easiest way, you re-execute the command just now, reloading the data will not affect the correctness after loading
-  - If you want to save time by avoiding reloading a file that has already been loaded, you can remove the TsFile that the last execution log shows has been loaded from the pending folder and reload that folder
diff --git a/docs/UserGuide/Write-Data/Batch-Load-Tool.md b/docs/UserGuide/Write-Data/Batch-Load-Tool.md
index 05af4f7b14..d6aa73854f 100644
--- a/docs/UserGuide/Write-Data/Batch-Load-Tool.md
+++ b/docs/UserGuide/Write-Data/Batch-Load-Tool.md
@@ -25,7 +25,7 @@ In different scenarios, the IoTDB provides a variety of methods for importing da
 
 ## TsFile Batch Load
 
-TsFile is the file format of time series used in IoTDB. You can directly import one or more TsFile files with time series into another running IoTDB instance through tools such as CLI. For details, see [TsFile Load Export Tools](../Maintenance-Tools/TsFile-Load-Export-Tool.md).
+TsFile is the file format of time series used in IoTDB. You can directly import one or more TsFile files with time series into another running IoTDB instance through tools such as CLI. For details, see [TsFile Load Tool](../Maintenance-Tools/Load-TsFile.md) [TsFile Export Tools](../Maintenance-Tools/TsFile-Load-Export-Tool.md).
 
 ## CSV Batch Load
 
diff --git a/docs/zh/UserGuide/Write-Data/Load-External-Tsfile.md b/docs/zh/UserGuide/Maintenance-Tools/Load-Tsfile.md
similarity index 68%
rename from docs/zh/UserGuide/Write-Data/Load-External-Tsfile.md
rename to docs/zh/UserGuide/Maintenance-Tools/Load-Tsfile.md
index efbb954d86..fba2063990 100644
--- a/docs/zh/UserGuide/Write-Data/Load-External-Tsfile.md
+++ b/docs/zh/UserGuide/Maintenance-Tools/Load-Tsfile.md
@@ -22,9 +22,9 @@
 # 加载 TsFile
 
 ## 介绍
-加载外部 tsfile 文件工具允许用户向正在运行中的 Apache IoTDB 中加载、删除或移出 tsfile 文件。
+加载外部 tsfile 文件工具允许用户向正在运行中的 Apache IoTDB 中加载 tsfile 文件。或者您也可以使用脚本的方式将tsfile加载进IoTDB。
 
-## 使用方式
+## 使用SQL加载
 用户通过 Cli 工具或 JDBC 向 Apache IoTDB 系统发送指定命令实现文件加载的功能。
 
 ### 加载 tsfile 文件
@@ -72,22 +72,39 @@ ONSUCCESS选项表示对于成功载入的tsfile的处置方式,默认为delet
 
 **注意**,如果`$IOTDB_HOME$/conf/iotdb-datanode.properties`中`enable_auto_create_schema=true`时会在加载tsfile的时候自动创建tsfile中的元数据,否则不会自动创建。
 
-### 删除 tsfile 文件
+## 使用脚本加载
 
-删除 tsfile 文件的指令为:`remove '<path>'`
+若您在Windows环境中,请运行`$IOTDB_HOME/tools/load-tsfile.bat`,若为Linux或Unix,请运行`load-tsfile.sh`
 
-该指令通过指定文件路径删除 tsfile 文件,具体做法是将该 tsfile 和其对应的`.resource`和`.modification`文件全部删除。
+```bash
+./load-tsfile.bat -f filePath [-h host] [-p port] [-u username] [-pw password] [--sgLevel int] [--verify true/false] [--onSuccess none/delete]
+-f 			待加载的文件或文件夹路径,必要字段
+-h 			IoTDB的Host地址,可选,默认127.0.0.1
+-p 			IoTDB的端口,可选,默认6667
+-u 			IoTDb登录用户名,可选,默认root
+-pw 		IoTDB登录密码,可选,默认root
+--sgLevel 	加载TsFile自动创建Database的路径层级,可选,默认值为iotdb-common.properties指定值
+--verify 	是否对加载TsFile进行元数据校验,可选,默认为True
+--onSuccess 对成功加载的TsFile的处理方法,可选,默认为delete,成功加载之后删除源TsFile,设为none时会				保留源TsFile
+```
 
-示例:
+### 使用范例
 
-* `remove '/Users/Desktop/data/data/root.vehicle/0/0/1575028885956-101-0.tsfile'`
+假定服务器192.168.0.101:6667上运行一个IoTDB实例,想从将本地保存的TsFile备份文件夹D:\IoTDB\data中的所有的TsFile文件都加载进此IoTDB实例。
 
-### 卸载 tsfile 文件至指定目录
+首先移动至`$IOTDB_HOME/tools/`,打开命令行,然后执行
 
-卸载 tsfile 文件的指令为:`unload '<path>' '<dir>'`
+```bash
+./load-tsfile.bat -f D:\IoTDB\data -h 192.168.0.101 -p 6667 -u root -pw root
+```
 
-该指令将指定路径的 tsfile 文件卸载并移动至目标文件夹(绝对路径)中,具体做法是在引擎中卸载该 tsfile,并将该 tsfile 文件和其对应的`.resource`文件移动到目标文件夹下
+等待脚本执行完成之后,可以检查IoTDB实例中数据已经被正确加载
 
-示例:
+### 常见问题
 
-* `unload '/Users/Desktop/data/data/root.vehicle/0/0/1575028885956-101-0.tsfile' '/data/data/tmp'`
+- 找不到或无法加载主类
+  - 可能是由于未设置环境变量$IOTDB_HOME,请设置环境变量之后重试
+- 提示-f option must be set!
+  - 输入命令缺少待-f字段(加载文件或文件夹路径),请添加之后重新执行
+- 执行到中途崩溃了想重新加载怎么办
+  - 重新执行刚才的命令,重新加载数据不会影响加载之后的正确性
\ No newline at end of file
diff --git a/docs/zh/UserGuide/Maintenance-Tools/Rewrite-TsFile-Tool.md b/docs/zh/UserGuide/Maintenance-Tools/Rewrite-TsFile-Tool.md
deleted file mode 100644
index 3ea6dba059..0000000000
--- a/docs/zh/UserGuide/Maintenance-Tools/Rewrite-TsFile-Tool.md
+++ /dev/null
@@ -1,62 +0,0 @@
-<!--
-
-    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 Rewrite-TsFile Tool
-
-## 工具介绍
-
-Rewrite-TsFile工具用于将TsFile中的数据写入正在运行的IoTDB中。
-
-## 使用方法
-
-若您在Windows环境中,请运行rewrite-tsfile.bat,若为Linux或Unix,请运行rewrite-tsfile.sh
-
-```bash
-./rewrite-tsfile.bat -f filePath [-h host] [-help] [-p port] [-pw password] -u user
--f 待加载的文件或文件夹路径,必要字段
--h IoTDB的Host地址,可选,默认127.0.0.1
--help 输出帮助菜单,可选
--p IoTDB的端口,可选,默认6667
--pw IoTDB登录密码,可选,默认root
--u IoTDb登录用户名,必要字段
-```
-
-## 使用范例
-
-假定服务器192.168.0.101:6667上运行一个IoTDB实例,想从将本地保存的TsFile备份文件夹D:\IoTDB\data中的所有的TsFile文件都加载进此IoTDB实例。
-
-首先移动到rewrite-tsfile.bat所在文件夹中,打开命令行,然后执行
-
-```bash
-./rewrite-tsfile.bat -f "D:\IoTDB\data" -h 192.168.0.101 -p 6667 -u root -pw root
-```
-
-等待脚本执行完成之后,可以检查IoTDB实例中数据已经被正确加载
-
-## 常见问题
-
-- 找不到或无法加载主类RewriteTsFileTool
-  - 可能是由于未设置环境变量$IOTDB_HOME,请设置环境变量之后重试
-- Missing require argument: f或Missing require argument: u
-  - 输入命令缺少待-f字段(加载文件或文件夹路径),或者缺少-u字段(用户名),请添加之后重新执行
-- 执行到中途崩溃了想重新加载怎么办
-  - 最简单的办法,您重新执行刚才的命令,重新加载数据不会影响加载之后的正确性
-  - 如果您想避免重新加载已经加载完成的文件来节省时间,您可以将上一次执行日志显示已经加载完成的TsFile从待加载文件夹中去掉,然后重新加载该文件夹
diff --git a/docs/zh/UserGuide/Write-Data/Batch-Load-Tool.md b/docs/zh/UserGuide/Write-Data/Batch-Load-Tool.md
index 577c83e535..617305a5e4 100644
--- a/docs/zh/UserGuide/Write-Data/Batch-Load-Tool.md
+++ b/docs/zh/UserGuide/Write-Data/Batch-Load-Tool.md
@@ -25,7 +25,7 @@
 
 ## TsFile批量导入
 
-TsFile 是在 IoTDB 中使用的时间序列的文件格式,您可以通过CLI等工具直接将存有时间序列的一个或多个 TsFile 文件导入到另外一个正在运行的IoTDB实例中。具体操作方式请参考 [TsFile 导入导出工具](../Maintenance-Tools/TsFile-Load-Export-Tool.md)。
+TsFile 是在 IoTDB 中使用的时间序列的文件格式,您可以通过CLI等工具直接将存有时间序列的一个或多个 TsFile 文件导入到另外一个正在运行的IoTDB实例中。具体操作方式请参考[TsFile 导入工具](../Maintenance-Tools/Load-TsFile.md),[TsFile 导出工具](../Maintenance-Tools/TsFile-Load-Export-Tool.md)。
 
 ## CSV批量导入
 
diff --git a/site/src/main/.vuepress/config.js b/site/src/main/.vuepress/config.js
index 2b5320ac4d..1d7e3f5090 100644
--- a/site/src/main/.vuepress/config.js
+++ b/site/src/main/.vuepress/config.js
@@ -907,7 +907,6 @@ var config = {
 							['Write-Data/Session','Native API Write'],
 							['Write-Data/REST-API','REST API'],
 							['Write-Data/MQTT','MQTT Write'],
-							['Write-Data/Load-External-Tsfile','Load External Tsfile'],
 							['Write-Data/Batch-Load-Tool','Batch Data Load']
 						]
 					},
@@ -964,8 +963,9 @@ var config = {
 							['Maintenance-Tools/Log-Tool','Log Tool'],
 							['Maintenance-Tools/JMX-Tool','JMX Tool'],
 							['Maintenance-Tools/MLogParser-Tool','MLogParser Tool'],
+							['Maintenance-Tools/Load-Tsfile','Load TsFile'],
 							['Maintenance-Tools/TsFile-Split-Tool','TsFile Split Tool'],
-							['Maintenance-Tools/TsFile-Load-Export-Tool','TsFile Load Export Tool'],
+							['Maintenance-Tools/TsFile-Load-Export-Tool','TsFile Export Tool'],
 							['Maintenance-Tools/CSV-Tool','CSV Load Export Tool'],
 						]
 					},
@@ -1859,7 +1859,6 @@ var config = {
 							['Write-Data/Session','原生接口写入'],
 							['Write-Data/REST-API','REST 服务'],
 							['Write-Data/MQTT','MQTT写入'],
-							['Write-Data/Load-External-Tsfile','加载 TsFile'],
 							['Write-Data/Batch-Load-Tool','批量数据导入']
 						]
 					},
@@ -1947,8 +1946,9 @@ var config = {
 							['Maintenance-Tools/Log-Tool','日志工具'],
 							['Maintenance-Tools/JMX-Tool','JMX 工具'],
 							['Maintenance-Tools/MLogParser-Tool','Mlog解析工具'],
+							['Maintenance-Tools/Load-Tsfile','加载 TsFile'],
 							['Maintenance-Tools/TsFile-Split-Tool','TsFile 拆分工具'],
-							['Maintenance-Tools/TsFile-Load-Export-Tool','TsFile 导入导出工具'],
+							['Maintenance-Tools/TsFile-Load-Export-Tool','TsFile 导出工具'],
 							['Maintenance-Tools/CSV-Tool','CSV 导入导出工具'],
 						]
 					},