Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,18 @@ ConfigNode maintenance includes adding and removing ConfigNodes. Common use case

**Linux / MacOS :**

```Plain
```Bash
sbin/start-confignode.sh
```

**Windows:**

```Plain
sbin/start-confignode.bat
```Bash
# Before version V2.0.4.x
sbin\start-confignode.bat

# V2.0.4.x and later versions
sbin\windows\start-confignode.bat
```

#### 4.1.2 Removing a ConfigNode
Expand Down Expand Up @@ -301,9 +305,15 @@ sbin/remove-confignode.sh [cn_internal_address:cn_internal_port]
**Windows:**

```Bash
sbin/remove-confignode.bat [confignode_id]
# Before version V2.0.4.x
sbin\remove-confignode.bat [confignode_id]
# Or:
sbin\remove-confignode.bat [cn_internal_address:cn_internal_port]

# V2.0.4.x and later versions
sbin\windows\remove-confignode.bat [confignode_id]
# Or:
sbin/remove-confignode.bat [cn_internal_address:cn_internal_port]
sbin\windows\remove-confignode.bat [cn_internal_address:cn_internal_port]
```

### 4.2 DataNode Maintenance
Expand All @@ -319,14 +329,18 @@ DataNode maintenance includes adding and removing DataNodes. Common use cases in

**Linux / MacOS:**

```Plain
```Bash
sbin/start-datanode.sh
```

**Windows:**

```Plain
sbin/start-datanode.bat
```Bash
# Before version V2.0.4.x
sbin\start-datanode.bat

# V2.0.4.x and later versions
sbin\windows\start-datanode.bat
```

**Note:** After adding a DataNode, the cluster load will gradually balance across all nodes as new writes arrive and old data expires (if TTL is set).
Expand Down Expand Up @@ -365,7 +379,11 @@ sbin/remove-datanode.sh [dn_rpc_address:dn_rpc_port]
**Windows:**

```Bash
sbin/remove-datanode.bat [dn_rpc_address:dn_rpc_port]
# Before version V2.0.4.x
sbin\remove-datanode.bat [dn_rpc_address:dn_rpc_port]

# V2.0.4.x and later versions
sbin\windows\remove-datanode.bat [dn_rpc_address:dn_rpc_port]
```

## 5. Common Issues
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,14 +303,18 @@ ConfigNode maintenance includes adding and removing ConfigNodes. Common use case

**Linux / MacOS :**

```Plain
```Bash
sbin/start-confignode.sh
```

**Windows:**

```Plain
sbin/start-confignode.bat
```Bash
# Before version V2.0.4.x
sbin\start-confignode.bat

# V2.0.4.x and later versions
sbin\windows\start-confignode.bat
```

#### 4.1.2 Removing a ConfigNode
Expand Down Expand Up @@ -349,9 +353,15 @@ sbin/remove-confignode.sh [cn_internal_address:cn_internal_port]
**Windows:**

```Bash
sbin/remove-confignode.bat [confignode_id]
# Before version V2.0.4.x
sbin\remove-confignode.bat [confignode_id]
# Or:
sbin\remove-confignode.bat [cn_internal_address:cn_internal_port]

# V2.0.4.x and later versions
sbin\windows\remove-confignode.bat [confignode_id]
# Or:
sbin/remove-confignode.bat [cn_internal_address:cn_internal_port]
sbin\windows\remove-confignode.bat [cn_internal_address:cn_internal_port]
```

### 4.2 DataNode Maintenance
Expand All @@ -367,14 +377,18 @@ DataNode maintenance includes adding and removing DataNodes. Common use cases in

**Linux / MacOS:**

```Plain
```Bash
sbin/start-datanode.sh
```

**Windows:**

```Plain
sbin/start-datanode.bat
```Bash
# Before version V2.0.4.x
sbin\start-datanode.bat

# V2.0.4.x and later versions
sbin\windows\start-datanode.bat
```

**Note:** After adding a DataNode, the cluster load will gradually balance across all nodes as new writes arrive and old data expires (if TTL is set).
Expand All @@ -383,13 +397,13 @@ sbin/start-datanode.bat

1. Connect to the cluster using the CLI and confirm the RPC address and port of the DataNode to be removed:

```Plain
```sql
show datanodes;
```

Example output:

```Plain
```sql
IoTDB> show datanodes
+------+-------+----------+-------+-------------+---------------+
|NodeID| Status|RpcAddress|RpcPort|DataRegionNum|SchemaRegionNum|
Expand All @@ -413,7 +427,11 @@ sbin/remove-datanode.sh [dn_rpc_address:dn_rpc_port]
**Windows:**

```Bash
sbin/remove-datanode.bat [dn_rpc_address:dn_rpc_port]
# Before version V2.0.4.x
sbin\remove-datanode.bat [dn_rpc_address:dn_rpc_port]

# V2.0.4.x and later versions
sbin\windows\remove-datanode.bat [dn_rpc_address:dn_rpc_port]
```

## 5. Common Issues
Expand Down
6 changes: 6 additions & 0 deletions src/UserGuide/Master/Table/Tools-System/CLI.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,15 @@ Shell> bash sbin/start-cli.sh -h 127.0.0.1 -p 6667 -u root -pw root -sql_dialect
#### **Windows**

```Bash
# Before version V2.0.4.x
Shell> sbin\start-cli.bat -sql_dialect table
#or
Shell> sbin\start-cli.bat -h 127.0.0.1 -p 6667 -u root -pw root -sql_dialect table

# V2.0.4.x and later versions
Shell> sbin\windows\start-cli.bat -sql_dialect table
#or
Shell> sbin\windows\start-cli.bat -h 127.0.0.1 -p 6667 -u root -pw root -sql_dialect table
```

**Parameter Explanation**
Expand Down
20 changes: 20 additions & 0 deletions src/UserGuide/Master/Table/Tools-System/Data-Export-Tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,17 @@ The data export tool `export-data.sh/bat` is located in the `tools` directory an
-t <target_directory> [-pfn <prefix_file_name>] [-dt <datatype>] [-lpf <lines_per_file>] [-tf <time_format>]
[-tz <timezone>] [-q <query_command>] [-timeout <query_timeout>]
# Windows
# Before version V2.0.4.x
> tools\export-data.bat -ft<format> [-sql_dialect<sql_dialect>] -db<database> -table<table>
[-start_time<start_time>] [-end_time<end_time>] [-h <host>] [-p <port>] [-u <username>] [-pw <password>]
-t <target_directory> [-pfn <prefix_file_name>] [-dt <datatype>] [-lpf <lines_per_file>] [-tf <time_format>]
[-tz <timezone>] [-q <query_command>] [-timeout <query_timeout>]

# V2.0.4.x and later versions
> tools\windows\export-data.bat -ft<format> [-sql_dialect<sql_dialect>] -db<database> -table<table>
[-start_time<start_time>] [-end_time<end_time>] [-h <host>] [-p <port>] [-u <username>] [-pw <password>]
-t <target_directory> [-pfn <prefix_file_name>] [-dt <datatype>] [-lpf <lines_per_file>] [-tf <time_format>]
[-tz <timezone>] [-q <query_command>] [-timeout <query_timeout>]
```
#### 2.2.2 CSV-Specific Parameters

Expand Down Expand Up @@ -90,10 +97,17 @@ Parse error: Missing required option: db
-lpf <lines_per_file> - [-tf <time_format>] [-tz <timezone>] [-q <query_command>] [-timeout <query_timeout>]

# Windows
# Before version V2.0.4.x
> tools\export-data.bat -ft<format> [-sql_dialect<sql_dialect>] -db<database> -table<table>
[-start_time<start_time>] [-end_time<end_time>] [-h <host> -p <port> -u <username> -pw <password>]
-t <target_directory> [-pfn <prefix_file_name> -aligned <export aligned insert sql>
-lpf <lines_per_file> -tf <time_format> -tz <timezone> -q <query_command> -timeout <query_timeout>]

# V2.0.4.x and later versions
> tools\windows\export-data.bat -ft<format> [-sql_dialect<sql_dialect>] -db<database> -table<table>
[-start_time<start_time>] [-end_time<end_time>] [-h <host> -p <port> -u <username> -pw <password>]
-t <target_directory> [-pfn <prefix_file_name> -aligned <export aligned insert sql>
-lpf <lines_per_file> -tf <time_format> -tz <timezone> -q <query_command> -timeout <query_timeout>]
```
#### 2.3.2 SQL-Specific Parameters

Expand Down Expand Up @@ -125,9 +139,15 @@ Parse error: Missing required option: db
-t <target_directory> [-pfn <prefix_file_name>] [-q <query_command>] [-timeout <query_timeout>]

# Windows
# Before version V2.0.4.x
> tools\export-data.bat -ft<format> [-sql_dialect<sql_dialect>] -db<database> -table<table>
[-start_time<start_time>] [-end_time<end_time>] [-h <host>] [-p <port>] [-u <username>] [-pw <password>]
-t <target_directory> [-pfn <prefix_file_name>] [-q <query_command>] [-timeout <query_timeout>]

# V2.0.4.x and later versions
> tools\windows\export-data.bat -ft<format> [-sql_dialect<sql_dialect>] -db<database> -table<table>
[-start_time<start_time>] [-end_time<end_time>] [-h <host>] [-p <port>] [-u <username>] [-pw <password>]
-t <target_directory> [-pfn <prefix_file_name>] [-q <query_command>] [-timeout <query_timeout>]
```

#### 2.4.2 TsFile-Specific Parameters
Expand Down
52 changes: 37 additions & 15 deletions src/UserGuide/Master/Table/Tools-System/Data-Import-Tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
IoTDB supports three methods for data import:
- Data Import Tool: Use the `import-data.sh/bat` script in the `tools` directory to manually import CSV, SQL, or TsFile (open-source time-series file format) data into IoTDB.
- `TsFile` Auto-Loading Feature
- Load `TsFile` SQL
- Load `TsFile` SQL

<table style="text-align: left;">
<tbody>
Expand Down Expand Up @@ -57,9 +57,9 @@ IoTDB supports three methods for data import:
| `-tz` | `--timezone` | Timezone (e.g., `+08:00`, `-01:00`). | No | System default |
| `-help` | `--help` | Display help (general or format-specific: `-help csv`). | No | - |

### 2.2 CSV Format
### 2.2 CSV Format

#### 2.2.1 Command
#### 2.2.1 Command
```Shell
# Unix/OS X
> tools/import-data.sh -ft<format> [-sql_dialect<sql_dialect>] -db<database> -table<table>
Expand All @@ -69,14 +69,22 @@ IoTDB supports three methods for data import:
[-tn <thread_num>]

# Windows
# Before version V2.0.4.x
> tools\import-data.bat -ft<format> [-sql_dialect<sql_dialect>] -db<database> -table<table>
[-h <host>] [-p <port>] [-u <username>] [-pw <password>]
-s <source> [-fd <fail_dir>] [-lpf <lines_per_failed_file>] [-aligned <use the aligned interface>]
[-ti <type_infer>] [-tp <timestamp precision (ms/us/ns)>] [-tz <timezone>] [-batch <batch_size>]
[-tn <thread_num>]

# V2.0.4.x and later versions
> tools\windows\import-data.bat -ft<format> [-sql_dialect<sql_dialect>] -db<database> -table<table>
[-h <host>] [-p <port>] [-u <username>] [-pw <password>]
-s <source> [-fd <fail_dir>] [-lpf <lines_per_failed_file>] [-aligned <use the aligned interface>]
[-ti <type_infer>] [-tp <timestamp precision (ms/us/ns)>] [-tz <timezone>] [-batch <batch_size>]
[-tn <thread_num>]
```

#### 2.2.2 CSV-Specific Parameters
#### 2.2.2 CSV-Specific Parameters

| Short | Full Parameter | Description | Required | Default |
| ---------------- | ------------------------------- |----------------------------------------------------------| ---------- |-----------------|
Expand All @@ -87,7 +95,7 @@ IoTDB supports three methods for data import:
| `-ti` | `--type_infer` | Type mapping (e.g., `BOOLEAN=text,INT=long`). | No | - |
| `-tp` | `--timestamp_precision` | Timestamp precision: `ms`, `us`, `ns`. | No | `ms` |

#### 2.2.3 Examples
#### 2.2.3 Examples

```Shell
# Valid Example
Expand All @@ -107,7 +115,7 @@ There are no tables or the target table table5 does not exist

- Special Character Escaping Rules: If a text-type field contains special characters (e.g., commas `,`), they must be escaped using a backslash (`\`).
- Supported Time Formats: `yyyy-MM-dd'T'HH:mm:ss`, `yyyy-MM-dd HH:mm:ss`, or `yyyy-MM-dd'T'HH:mm:ss.SSSZ`.
- Timestamp Column Requirement: The timestamp column must be the first column in the data file.
- Timestamp Column Requirement: The timestamp column must be the first column in the data file.

2. CSV File Example

Expand All @@ -118,9 +126,9 @@ time,region,device,model,temperature,humidity
```


### 2.3 SQL Format
### 2.3 SQL Format

#### 2.3.1 Command
#### 2.3.1 Command

```Shell
# Unix/OS X
Expand All @@ -130,21 +138,28 @@ time,region,device,model,temperature,humidity
[-batch <batch_size>] [-tn <thread_num>]

# Windows
# Before version V2.0.4.x
> tools\import-data.bat -ft<format> [-sql_dialect<sql_dialect>] -db<database> -table<table>
[-h <host>] [-p <port>] [-u <username>] [-pw <password>]
-s<source> [-fd <fail_dir>] [-lpf <lines_per_failed_file>] [-tz <timezone>]
[-batch <batch_size>] [-tn <thread_num>]

# V2.0.4.x and later versions
> tools\windows\import-data.bat -ft<format> [-sql_dialect<sql_dialect>] -db<database> -table<table>
[-h <host>] [-p <port>] [-u <username>] [-pw <password>]
-s<source> [-fd <fail_dir>] [-lpf <lines_per_failed_file>] [-tz <timezone>]
[-batch <batch_size>] [-tn <thread_num>]
```

#### 2.3.2 SQL-Specific Parameters
#### 2.3.2 SQL-Specific Parameters

| Short | Full Parameter | Description | Required | Default |
| -------------- | ------------------------------- | -------------------------------------------------------------------- | ---------- | ------------------ |
| `-fd` | `--fail_dir` | Directory to save failed files. | No |YOUR_CSV_FILE_PATH|
| `-lpf` | `--lines_per_failed_file` | Max lines per failed file. | No | `100000` <br> Range: 0 to Integer.Max(2147483647). |
| `-batch` | `--batch_size` | Rows processed per API call. | No | `100000` <br> Range: 0 to Integer.Max(2147483647). |

#### 2.3.3 Examples
#### 2.3.3 Examples

```Shell
# Valid Example
Expand All @@ -158,9 +173,9 @@ Source file or directory ./sql/dump1_1.sql does not exist
# Log Example
Fail to insert measurements '[column.name]' caused by [data type is not consistent, input '[column.value]', registered '[column.DataType]']
```
### 2.4 TsFile Format
### 2.4 TsFile Format

#### 2.4.1 Command
#### 2.4.1 Command

```Shell
# Unix/OS X
Expand All @@ -170,12 +185,19 @@ Fail to insert measurements '[column.name]' caused by [data type is not consiste
[-tn <thread_num> ] [-tz <timezone>] [-tp <timestamp precision (ms/us/ns)>]

# Windows
# Before version V2.0.4.x
> tools\import-data.bat -ft <format> [-sql_dialect<sql_dialect>] -db<database> -table<table>
[-h <host>] [-p <port>] [-u <username>] [-pw <password>]
-s <source> -os <on_success> [-sd <success_dir>] -of <on_fail> [-fd <fail_dir>]
[-tn <thread_num> ] [-tz <timezone>] [-tp <timestamp precision (ms/us/ns)>]

# V2.0.4.x and later versions
> tools\windows\import-data.bat -ft <format> [-sql_dialect<sql_dialect>] -db<database> -table<table>
[-h <host>] [-p <port>] [-u <username>] [-pw <password>]
-s <source> -os <on_success> [-sd <success_dir>] -of <on_fail> [-fd <fail_dir>]
[-tn <thread_num> ] [-tz <timezone>] [-tp <timestamp precision (ms/us/ns)>]
```
#### 2.4.2 TsFile-Specific Parameters
#### 2.4.2 TsFile-Specific Parameters

| Short | Full Parameter | Description | Required | Default |
| ----------- | ----------------------------- |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| ----------------- | --------------------------- |
Expand All @@ -185,7 +207,7 @@ Fail to insert measurements '[column.name]' caused by [data type is not consiste
| `-fd` | `--fail_dir` | Target directory for `mv`/`cp` actions on failure. Required if `-of` is `mv`/`cp`. The file name will be flattened and concatenated with the original file name. | Conditional | `${EXEC_DIR}/fail` |
| `-tp` | `--timestamp_precision` | TsFile timestamp precision: `ms`, `us`, `ns`. <br> For non-remote TsFile imports: Use -tp to specify the timestamp precision of the TsFile. The system will manually verify if the timestamp precision matches the server. If it does not match, an error will be returned. <br> ​For remote TsFile imports: Use -tp to specify the timestamp precision of the TsFile. The Pipe system will automatically verify if the timestamp precision matches. If it does not match, a Pipe error will be returned. | No | `ms` |

#### 2.4.3 Examples
#### 2.4.3 Examples

```Shell
# Valid Example
Expand Down Expand Up @@ -225,7 +247,7 @@ load_active_listening_dir/
```

- Table model TsFile
- `temperature-table.TSFILE`: will be imported into the `temperature` database (because it is located in the `sensors/temperature/` directory)
- `temperature-table.TSFILE`: will be imported into the `temperature` database (because it is located in the `sensors/temperature/` directory)


### 3.3 Notes
Expand Down
Loading