Skip to content

Commit 214c133

Browse files
authored
add health check in deployment (#872)
1 parent d2a2da3 commit 214c133

File tree

60 files changed

+1516
-19
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1516
-19
lines changed

src/.vuepress/sidebar/V2.0.x/en-Table.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ export const enSidebar = {
145145
{ text: 'Schema Export', link: 'Schema-Export-Tool_apache' },
146146
],
147147
},
148+
{ text: 'Full Backup Tool', link: 'Backup-Tool' },
149+
{ text: 'Health Check Tool', link: 'Health-Check-Tool' },
148150
],
149151
},
150152
{

src/.vuepress/sidebar/V2.0.x/zh-Table.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ export const zhSidebar = {
135135
{ text: '元数据导出', link: 'Schema-Export-Tool_apache' },
136136
],
137137
},
138+
{ text: '全量备份工具', link: 'Backup-Tool' },
139+
{ text: '健康检查工具', link: 'Health-Check-Tool' },
138140
],
139141
},
140142
{

src/.vuepress/sidebar_timecho/V2.0.x/en-Table.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ export const enSidebar = {
150150
{ text: 'Schema Export', link: 'Schema-Export-Tool_timecho' },
151151
],
152152
},
153+
{ text: 'Full Backup Tool', link: 'Backup-Tool' },
154+
{ text: 'Health Check Tool', link: 'Health-Check-Tool' },
153155
],
154156
},
155157
{

src/.vuepress/sidebar_timecho/V2.0.x/zh-Table.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ export const zhSidebar = {
139139
{ text: '元数据导出', link: 'Schema-Export-Tool_timecho' },
140140
],
141141
},
142+
{ text: '全量备份工具', link: 'Backup-Tool' },
143+
{ text: '健康检查工具', link: 'Health-Check-Tool' },
142144
],
143145
},
144146
{

src/UserGuide/Master/Table/Deployment-and-Maintenance/Cluster-Deployment_apache.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ Use the hostname for `cn_internal_address` and `dn_internal_address` in IoTDB co
4242
3. **Unmodifiable Parameters**: Some parameters cannot be changed after the first startup. Refer to the [Parameter Configuration](#22-parameters-configuration) section.
4343

4444

45-
1. **Installation Path**: Ensure the installation path contains no spaces or non-ASCII characters to prevent runtime issues.
46-
2. **User Permissions**: Choose one of the following permissions during installation and deployment:
45+
4. **Installation Path**: Ensure the installation path contains no spaces or non-ASCII characters to prevent runtime issues.
46+
5. **User Permissions**: Choose one of the following permissions during installation and deployment:
4747
- **Root User (Recommended)**: This avoids permission-related issues.
4848
- **Non-Root User**:
4949
- Use the same user for all operations, including starting, activating, and stopping services.
5050
- Avoid using `sudo`, which can cause permission conflicts.
5151

52-
6. **Monitoring Panel**: Deploy a monitoring panel to track key performance metrics. Contact the Timecho team for access and refer to the [Monitoring Board Install and Deploy](../Deployment-and-Maintenance/Monitoring-panel-deployment.md).
52+
6. **Health Check Tool**: Before installation, the health check tool can help inspect the operating environment of IoTDB nodes and obtain detailed inspection results. The usage method of the IoTDB health check tool can be found in:[Health Check Tool](../Tools-System/Health-Check-Tool.md).
5353

5454
## 2. Preparation
5555

src/UserGuide/Master/Table/Deployment-and-Maintenance/Cluster-Deployment_timecho.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,18 @@ Use the hostname for `cn_internal_address` and `dn_internal_address` in IoTDB co
4242
3. **Unmodifiable Parameters**: Some parameters cannot be changed after the first startup. Refer to the [Parameter Configuration](#22-parameters-configuration) section.
4343

4444

45-
1. **Installation Path**: Ensure the installation path contains no spaces or non-ASCII characters to prevent runtime issues.
46-
2. **User Permissions**: Choose one of the following permissions during installation and deployment:
45+
4. **Installation Path**: Ensure the installation path contains no spaces or non-ASCII characters to prevent runtime issues.
46+
5. **User Permissions**: Choose one of the following permissions during installation and deployment:
4747
- **Root User (Recommended)**: This avoids permission-related issues.
4848
- **Non-Root User**:
4949
- Use the same user for all operations, including starting, activating, and stopping services.
5050
- Avoid using `sudo`, which can cause permission conflicts.
5151

5252
6. **Monitoring Panel**: Deploy a monitoring panel to track key performance metrics. Contact the Timecho team for access and refer to the [Monitoring Board Install and Deploy](../Deployment-and-Maintenance/Monitoring-panel-deployment.md).
5353

54+
7. **Health Check Tool**: Before installation, the health check tool can help inspect the operating environment of IoTDB nodes and obtain detailed inspection results. The usage method of the IoTDB health check tool can be found in:[Health Check Tool](../Tools-System/Health-Check-Tool.md).
55+
56+
5457
## 2. Preparation
5558

5659
1. Obtain the TimechoDB installation package: `timechodb-{version}-bin.zip` following [IoTDB-Package](../Deployment-and-Maintenance/IoTDB-Package_timecho.md)

src/UserGuide/Master/Table/Deployment-and-Maintenance/Stand-Alone-Deployment_apache.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Use the hostname for `cn_internal_address` and `dn_internal_address` in IoTDB co
4444
- Use the same user for all operations, including starting, activating, and stopping services.
4545
- Avoid using `sudo`, which can cause permission conflicts.
4646

47-
6. **Monitoring Panel**: Deploy a monitoring panel to track key performance metrics. Contact the Timecho team for access and refer to the [Monitoring Board Install and Deploy](../Deployment-and-Maintenance/Monitoring-panel-deployment.md).
47+
6. **Health Check Tool**: Before installation, the health check tool can help inspect the operating environment of IoTDB nodes and obtain detailed inspection results. The usage method of the IoTDB health check tool can be found in:[Health Check Tool](../Tools-System/Health-Check-Tool.md).
4848

4949
## 2. Installation Steps
5050

src/UserGuide/Master/Table/Deployment-and-Maintenance/Stand-Alone-Deployment_timecho.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ Use the hostname for `cn_internal_address` and `dn_internal_address` in IoTDB co
4646

4747
6. **Monitoring Panel**: Deploy a monitoring panel to track key performance metrics. Contact the Timecho team for access and refer to the [Monitoring Board Install and Deploy](../Deployment-and-Maintenance/Monitoring-panel-deployment.md).
4848

49+
7. **Health Check Tool**: Before installation, the health check tool can help inspect the operating environment of IoTDB nodes and obtain detailed inspection results. The usage method of the IoTDB health check tool can be found in:[Health Check Tool](../Tools-System/Health-Check-Tool.md).
50+
51+
4952
## 2. Installation Steps
5053

5154
### 2.1 Pre-installation Check
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
<!--
2+
3+
Licensed to the Apache Software Foundation (ASF) under one
4+
or more contributor license agreements. See the NOTICE file
5+
distributed with this work for additional information
6+
regarding copyright ownership. The ASF licenses this file
7+
to you under the Apache License, Version 2.0 (the
8+
"License"); you may not use this file except in compliance
9+
with the License. You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing,
14+
software distributed under the License is distributed on an
15+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
KIND, either express or implied. See the License for the
17+
specific language governing permissions and limitations
18+
under the License.
19+
20+
-->
21+
22+
# Backup Tool
23+
24+
## 1. Overview
25+
26+
The IoTDB Full Backup Tool is designed to create a full backup of a single IoTDB node’s data via hard links to a specified local directory. The backup can then be directly started and joined to the original cluster. The tool offers two modes: **Quick Mirror Mode** and **Manual Backup Path Mode**.
27+
28+
> **Notes**:
29+
>
30+
> * **Stop the IoTDB service before starting the backup**.
31+
> * The script runs in the background by default, and logs are saved to log files during execution.
32+
33+
34+
## 2. Backup Modes
35+
36+
### 2.1 Mode 1: Quick Mirror Mode
37+
38+
#### Usage
39+
40+
```bash
41+
backup.sh/backup.bat -quick -node xxx
42+
# Optional values for xxx are shown in the following examples
43+
44+
backup.sh/backup.bat -quick -node
45+
# Back up all nodes to the default path
46+
47+
backup.sh/backup.bat -quick -node all
48+
# Back up all nodes to the default path
49+
50+
backup.sh/backup.bat -quick -node confignode
51+
# Back up only the ConfigNode to the default path
52+
53+
backup.sh/backup.bat -quick -node datanode
54+
# Back up only the DataNode to the default path
55+
```
56+
57+
#### Parameter Descriptions
58+
59+
| **Parameter** | **Description** | **Required** |
60+
| ----------------------- |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| ---------------------- |
61+
| `-quick` | Enables Quick Mirror Mode. | No |
62+
| `-node` | Specifies the node type to back up. Options: `all`, `datanode`, or `confignode`. Default: `all`. <br>`all`: Back up both DataNode and ConfigNode. <br>`datanode`: Back up only the DataNode. <br>`confignode`: Back up only the ConfigNode. | No |
63+
64+
**Process Details**:
65+
66+
1. Check if the `_backup` folder already exists in the current IoTDB directory or paths specified in the configuration file. If it exists, the tool exits with the error: `The backup folder already exists`.
67+
> When the backup folder already exists, you can try the following solutions:
68+
> * Delete the existing _backup folder and retry the backup.
69+
> * Modify the backup path to avoid conflicts.
70+
71+
2. Create hard links from the original `dn_data_dirs` paths to the corresponding `_backup` paths.
72+
* Example: If `dn_data_dirs=/data/iotdb/data/datanode/data`, the backup data will be stored in `/data/iotdb/data/datanode/data_backup`.
73+
3. Copy other files from the IoTDB directory (e.g., `/data/iotdb`) to the `_backup` path (e.g., `/data/iotdb_backup`).
74+
75+
76+
### 2.2 Mode 2: Manual Backup Path Mode
77+
78+
#### Usage
79+
80+
```bash
81+
backup.sh -node xxx -targetdir xxx -targetdatadir xxx -targetwaldir xxx
82+
```
83+
84+
#### Parameter Descriptions
85+
86+
| **Parameter** | **Description** | **Required** |
87+
| ----------------------- | -------------------------------------------------------------------------------------------- | ---------------------- |
88+
| `-node` | Node type to back up (`all`, `datanode`, or `confignode`). Default: `all`. | No |
89+
| `-targetdir` | Target directory for backing up the IoTDB folder. | **Yes** |
90+
| `-targetdatadir` | Target path for `dn_data_dirs` files. Default: `targetdir/data/datanode/data`. | No |
91+
| `-targetwaldir` | Target path for `dn_wal_dirs` files. Default: `targetdir/data/datanode/wal`. | No |
92+
93+
**Process Details**:
94+
95+
1. The `-targetdir` parameter is mandatory. If missing, the tool exits with the error: `-targetdir cannot be empty. The backup folder must be specified`.
96+
2. Validate consistency between configuration paths (`dn_data_dirs`, `dn_wal_dirs`) and parameters (`-targetdatadir`, `-targetwaldir`):
97+
98+
* If `-targetdatadir` or `-targetwaldir` is a single path, it is considered consistent.
99+
* If the number of source paths (from configuration) does not match the target paths, the tool exits with the error: `-targetdatadir parameter exception: the number of original paths does not match the specified paths`.
100+
3. Check if `-targetdatadir` paths are on the same disk as the original paths:
101+
102+
* **Same disk**: Attempt to create hard links. If hard links fail, copy files instead.
103+
* **Different disk**: Copy files directly.
104+
4. Path Matching Rules
105+
106+
* **Many-to-One**: Multiple source paths can be backed up to a single target path.
107+
* **One-to-One**: A single source path can be backed up to a single target path.
108+
* **Many-to-Many**: Multiple source paths can be backed up to multiple target paths, but the pattern must match.
109+
110+
#### Examples
111+
112+
| **Configuration Paths** | **`-targetdatadir` Paths** | **Result** |
113+
| ------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------- |
114+
| `/data/iotdb/data/datanode/data` | `/data/iotdb_backup/data/datanode/data` |**Consistent** |
115+
| `/data/iotdb/data/datanode/data` | `/data/iotdb_backup/data/datanode/data1,/data/iotdb_backup/data/datanode/data2` | **Inconsistent** |
116+
| `/data/iotdb/data/datanode/data1,/data/iotdb/data/datanode/data2` | `/data/iotdb_backup/data/datanode/data` | **Consistent** |
117+
| `/data/iotdb/data/datanode/data1,/data/iotdb/data/datanode/data2` | `/data/iotdb_backup/data/datanode/data3,/data/iotdb_backup/data/datanode/data4` | **Consistent** |
118+
| `/data/iotdb/data/datanode/data1,/data/iotdb/data/datanode/data2;/data/iotdb/data/datanode/data3` | `/data/iotdb_backup/data/datanode/data` | **Consistent** |
119+
| `/data/iotdb/data/datanode/data1,/data/iotdb/data/datanode/data2;/data/iotdb/data/datanode/data3` | `/data/iotdb_backup/data/datanode/data1;/data/iotdb_backup/data/datanode/data1` | **Consistent** |
120+
| `/data/iotdb/data/datanode/data1,/data/iotdb/data/datanode/data2;/data/iotdb/data/datanode/data3` | `/data/iotdb_backup/data/datanode/data1,/data/iotdb_backup/data/datanode/data3;/data/iotdb_backup/data/datanode/data` | **Consistent** |
121+
| `/data/iotdb/data/datanode/data1,/data/iotdb/data/datanode/data2;/data/iotdb/data/datanode/data3` | `/data/iotdb_backup/data/datanode/data1,/data/iotdb_backup/data/datanode/data3;/data/iotdb_backup/data/datanode/data1,/data/iotdb_backup/data/datanode/data4` | **Inconsistent** |
122+
123+
#### Path Matching Rules Summary
124+
125+
* **Paths separated by `;` only**:
126+
* `-targetdatadir` can be a single path (no `;` or `,`).
127+
* `-targetdatadir` can also use `;` to split paths, but the count must match the source paths.
128+
* **Paths separated by `,` only**:
129+
* `-targetdatadir` can be a single path (no `;` or `,`).
130+
* `-targetdatadir` can also use `,` to split paths, but the count must match the source paths.
131+
* **Paths with both `;` and `,`**:
132+
* `-targetdatadir` can be a single path (no `;` or `,`).
133+
* Split paths first by `;`, then by `,`. The number of paths at each level must match.
134+
135+
> **Note**: The `dn_wal_dirs` parameter (for WAL paths) follows the same rules as `dn_data_dirs`.

0 commit comments

Comments
 (0)