From 06ebbe957d8fb97516d855d3630b4a0e6accca38 Mon Sep 17 00:00:00 2001 From: Leto_b Date: Mon, 10 Mar 2025 14:20:38 +0800 Subject: [PATCH 1/2] add health check tool in 1.3.x 2.0.x master --- src/.vuepress/sidebar/V1.3.x/en.ts | 1 + src/.vuepress/sidebar/V1.3.x/zh.ts | 1 + src/.vuepress/sidebar/V2.0.x/en-Tree.ts | 1 + src/.vuepress/sidebar/V2.0.x/zh-Tree.ts | 1 + src/.vuepress/sidebar_timecho/V1.3.x/en.ts | 1 + src/.vuepress/sidebar_timecho/V1.3.x/zh.ts | 1 + .../sidebar_timecho/V2.0.x/en-Tree.ts | 1 + .../sidebar_timecho/V2.0.x/zh-Tree.ts | 1 + .../Tree/Tools-System/Health-Check-Tool.md | 213 +++++++++++++++++ .../V1.3.x/Tools-System/Health-Check-Tool.md | 214 +++++++++++++++++ .../latest/Tools-System/Health-Check-Tool.md | 213 +++++++++++++++++ .../Tree/Tools-System/Health-Check-Tool.md | 220 +++++++++++++++++ .../V1.3.x/Tools-System/Health-Check-Tool.md | 221 ++++++++++++++++++ .../latest/Tools-System/Health-Check-Tool.md | 220 +++++++++++++++++ 14 files changed, 1309 insertions(+) create mode 100644 src/UserGuide/Master/Tree/Tools-System/Health-Check-Tool.md create mode 100644 src/UserGuide/V1.3.x/Tools-System/Health-Check-Tool.md create mode 100644 src/UserGuide/latest/Tools-System/Health-Check-Tool.md create mode 100644 src/zh/UserGuide/Master/Tree/Tools-System/Health-Check-Tool.md create mode 100644 src/zh/UserGuide/V1.3.x/Tools-System/Health-Check-Tool.md create mode 100644 src/zh/UserGuide/latest/Tools-System/Health-Check-Tool.md diff --git a/src/.vuepress/sidebar/V1.3.x/en.ts b/src/.vuepress/sidebar/V1.3.x/en.ts index 2a4dcadb5..2d8edb7bb 100644 --- a/src/.vuepress/sidebar/V1.3.x/en.ts +++ b/src/.vuepress/sidebar/V1.3.x/en.ts @@ -158,6 +158,7 @@ export const enSidebar = { { text: 'TsFile Import Export(V1.3.0/1/2)', link: 'TsFile-Import-Export-Tool' }, { text: 'Data Import(V1.3.3)', link: 'Data-Import-Tool' }, { text: 'Data Export(V1.3.3)', link: 'Data-Export-Tool' }, + { text: 'Health Check Tool(V1.3.2)', link: 'Health-Check-Tool' }, ], }, { diff --git a/src/.vuepress/sidebar/V1.3.x/zh.ts b/src/.vuepress/sidebar/V1.3.x/zh.ts index bba878fda..f5adc1cbb 100644 --- a/src/.vuepress/sidebar/V1.3.x/zh.ts +++ b/src/.vuepress/sidebar/V1.3.x/zh.ts @@ -145,6 +145,7 @@ export const zhSidebar = { { text: 'TsFile导入导出(V1.3.0/1/2)', link: 'TsFile-Import-Export-Tool' }, { text: '数据导入(V1.3.3)', link: 'Data-Import-Tool' }, { text: '数据导出(V1.3.3)', link: 'Data-Export-Tool' }, + { text: '健康检查工具(V1.3.2)', link: 'Health-Check-Tool' }, ], }, { diff --git a/src/.vuepress/sidebar/V2.0.x/en-Tree.ts b/src/.vuepress/sidebar/V2.0.x/en-Tree.ts index c811aafe2..b8279b2fe 100644 --- a/src/.vuepress/sidebar/V2.0.x/en-Tree.ts +++ b/src/.vuepress/sidebar/V2.0.x/en-Tree.ts @@ -139,6 +139,7 @@ export const enSidebar = { { text: 'Cluster Management Tool', link: 'Maintenance-Tool_apache' }, { text: 'Data Import', link: 'Data-Import-Tool' }, { text: 'Data Export', link: 'Data-Export-Tool' }, + { text: 'Health Check Tool', link: 'Health-Check-Tool' }, ], }, { diff --git a/src/.vuepress/sidebar/V2.0.x/zh-Tree.ts b/src/.vuepress/sidebar/V2.0.x/zh-Tree.ts index d647a2824..bb8f52c9a 100644 --- a/src/.vuepress/sidebar/V2.0.x/zh-Tree.ts +++ b/src/.vuepress/sidebar/V2.0.x/zh-Tree.ts @@ -126,6 +126,7 @@ export const zhSidebar = { { text: '集群管理工具', link: 'Maintenance-Tool_apache' }, { text: '数据导入', link: 'Data-Import-Tool' }, { text: '数据导出', link: 'Data-Export-Tool' }, + { text: '健康检查工具', link: 'Health-Check-Tool' }, ], }, { diff --git a/src/.vuepress/sidebar_timecho/V1.3.x/en.ts b/src/.vuepress/sidebar_timecho/V1.3.x/en.ts index 8c838d83a..29afd431b 100644 --- a/src/.vuepress/sidebar_timecho/V1.3.x/en.ts +++ b/src/.vuepress/sidebar_timecho/V1.3.x/en.ts @@ -172,6 +172,7 @@ export const enSidebar = { { text: 'TsFile Import Export(V1.3.0/1/2)', link: 'TsFile-Import-Export-Tool' }, { text: 'Data Import(V1.3.3)', link: 'Data-Import-Tool' }, { text: 'Data Export(V1.3.3)', link: 'Data-Export-Tool' }, + { text: 'Health Check Tool(V1.3.2)', link: 'Health-Check-Tool' }, ], }, { diff --git a/src/.vuepress/sidebar_timecho/V1.3.x/zh.ts b/src/.vuepress/sidebar_timecho/V1.3.x/zh.ts index 52ebf6fa5..30b7522ea 100644 --- a/src/.vuepress/sidebar_timecho/V1.3.x/zh.ts +++ b/src/.vuepress/sidebar_timecho/V1.3.x/zh.ts @@ -155,6 +155,7 @@ export const zhSidebar = { { text: 'TsFile导入导出(V1.3.0/1/2)', link: 'TsFile-Import-Export-Tool' }, { text: '数据导入(V1.3.3)', link: 'Data-Import-Tool' }, { text: '数据导出(V1.3.3)', link: 'Data-Export-Tool' }, + { text: '健康检查工具(V1.3.2)', link: 'Health-Check-Tool' }, ], }, { diff --git a/src/.vuepress/sidebar_timecho/V2.0.x/en-Tree.ts b/src/.vuepress/sidebar_timecho/V2.0.x/en-Tree.ts index 7f2db058b..500d70bfd 100644 --- a/src/.vuepress/sidebar_timecho/V2.0.x/en-Tree.ts +++ b/src/.vuepress/sidebar_timecho/V2.0.x/en-Tree.ts @@ -153,6 +153,7 @@ export const enSidebar = { { text: 'Cluster Management Tool', link: 'Maintenance-Tool_timecho' }, { text: 'Data Import', link: 'Data-Import-Tool' }, { text: 'Data Export', link: 'Data-Export-Tool' }, + { text: 'Health Check Tool', link: 'Health-Check-Tool' }, ], }, { diff --git a/src/.vuepress/sidebar_timecho/V2.0.x/zh-Tree.ts b/src/.vuepress/sidebar_timecho/V2.0.x/zh-Tree.ts index cceff4741..31675302f 100644 --- a/src/.vuepress/sidebar_timecho/V2.0.x/zh-Tree.ts +++ b/src/.vuepress/sidebar_timecho/V2.0.x/zh-Tree.ts @@ -136,6 +136,7 @@ export const zhSidebar = { { text: '集群管理工具', link: 'Maintenance-Tool_timecho' }, { text: '数据导入', link: 'Data-Import-Tool' }, { text: '数据导出', link: 'Data-Export-Tool' }, + { text: '健康检查工具', link: 'Health-Check-Tool' }, ], }, { diff --git a/src/UserGuide/Master/Tree/Tools-System/Health-Check-Tool.md b/src/UserGuide/Master/Tree/Tools-System/Health-Check-Tool.md new file mode 100644 index 000000000..312664b15 --- /dev/null +++ b/src/UserGuide/Master/Tree/Tools-System/Health-Check-Tool.md @@ -0,0 +1,213 @@ + + +# Health Check Tool + +## 1. Overview +The IoTDB Health Check Tool is designed to inspect the runtime environment of IoTDB nodes. It assists users in verifying the node's environment both before deployment and during operation, providing detailed inspection reports. + + +## 2. Prerequisites + +Linux Systems + +* `nc` (netcat) tool: Installed by default; user must have execution permissions. +* `lsof` or `netstat`: At least one must be installed; user must have execution permissions. + +> To verify tool installation: +> +>Check `nc`: `nc -h` +> +>Check `lsof`: `lsof -v` + +Windows Systems + +* PowerShell: Enabled by default. + +## 3. Inspection Items +* Check port occupancy on the node's server (Windows/Linux). +* Verify port connectivity between the current node and other cluster nodes (Windows/Linux). +* Check JDK installation (JAVA_HOME) (Windows/Linux). +* Inspect system memory allocation and IoTDB memory configuration (Windows/Linux). +* Validate directory access permissions (Windows/Linux). +* Ensure the system's maximum number of open files meets requirements (≥ 65535) (Linux only). +* Confirm swap is disabled (Windows/Linux). + +## 4. Usage Instructions +### 4.1 Command Format +```bash +health_check.sh/health_check.bat -ips -o +``` +### 4.2 Parameter Descriptions + +|**Parameter** |**Description** | ​**Required** | +| --------------------- | --------------------------------------------------------------------------------------------------------------------- | ---------------------- | +| `-ips` | Remote server IPs and ports. Supports multiple servers. Format: `ip port1 port2, ip2 port2-1 port2-2` | Optional | +| `-o` | Scope of check: `local` (local machine), `remote` (remote server ports), `all` (both). Default: `all` | Optional | + + +## 5. Usage Examples +### 5.1 Example 1: Check All +```bash + health_check.sh/health_check.bat -ips 172.20.31.19 6667 18080,10.0.6.230 10311 +``` + +Output: + +```bash +Check: Installation Environment(JDK) +Requirement: JDK Version >=1.8 +Result: JDK Version 11.0.21 + +Check: Installation Environment(Memory) +Requirement: Allocate sufficient memory for IoTDB +Result: Total Memory 7.8Gi, 2.33 G allocated to IoTDB ConfigNode, 3.88 G allocated to IoTDB DataNode + +Check: Installation Environment(Directory Access) +Requirement: IoTDB needs write permissions for data/datanode/data, data/datanode/consensus, data/datanode/system, data/datanode/wal, data/confignode/system, data/confignode/consensus, ext/pipe, ext/udf, ext/trigger. +Result: +data/datanode/data has write permission +data/datanode/consensus has write permission +data/datanode/system has write permission +data/datanode/wal has write permission +data/confignode/system has write permission +data/confignode/consensus has write permission +ext/pipe has write permission +ext/udf has write permission +ext/trigger has write permission + +Check: Network(Local Port) +Requirement: Ports 16668, 10730, 11742, 10750, 10760, 10710, 10720 must be unoccupied +Result: +Ports 16668, 10730, 11742, 10750, 10760, 10710, 10720 are free + +Check: Network(Remote Port Connectivity) +Requirement: 172.20.31.19:6667, 18080 and 10.0.6.230:10311 must be accessible +Result: +Inaccessible server ports: +IP: 10.0.6.230, Ports: 10311 + +Check: System Settings(Maximum Open Files Number) +Requirement: >= 65535 +Result: 65535 + +Check: System Settings(Swap) +Requirement: Disabled +Result: Disabled. +``` + +### 5.2 Example 2: Local Check + +```bash +health_check.sh/health_check.bat -o local +``` + +Output: + +```bash +Check: Installation Environment(JDK) +Requirement: JDK Version >=1.8 +Result: JDK Version 11.0.21 + +Check: Installation Environment(Memory) +Requirement: Allocate sufficient memory for IoTDB +Result: Total Memory 7.8Gi, 2.33 G allocated to IoTDB ConfigNode, 3.88 G allocated to IoTDB DataNode + +Check: Installation Environment(Directory Access) +Requirement: IoTDB needs data/datanode/data,data/datanode/consensus,data/datanode/system,data/datanode/wal,data/confignode/system,data/confignode/consensus,ext/pipe,ext/udf,ext/trigger write permission. +Result: +data/datanode/data has write permission +data/datanode/consensus has write permission +data/datanode/system has write permission +data/datanode/wal has write permission +data/confignode/system has write permission +data/confignode/consensus has write permission +ext/pipe has write permission +ext/udf has write permission +ext/trigger has write permission + +Check: Network(Local Port) +Requirement: Port 16668 10730 11742 10750 10760 10710 10720 is not occupied +Result: +Port 16668 10730 11742 10750 10760 10710 10720 is free + +Check: System Settings(Maximum Open Files Number) +Requirement: >= 65535 +Result: 65535 + +Check: System Settings(Swap) +Requirement: disabled +Result: disabled. +``` + +### 5.3 Example 3: Remote Check +```bash +health_check.sh/health_check.bat -o remote -ips 172.20.31.19 6667 18080,10.0.6.230 10311 +``` + +Output: + +```bash +Check: Network(Remote Port Connectivity) +Requirement: 172.20.31.19:6667, 18080 and 10.0.6.230:10311 must be accessible +Result: +Inaccessible server ports: +IP: 10.0.6.230, Ports: 10311 +``` + +## 6. FAQs +### 6.1 How to Adjust Memory Allocation + +* Modify MEMORY\_SIZE in `confignode-env.sh`. +* Modify MEMORY\_SIZE in `datanode-env.sh`. + +### 6.2 How to Modify Max Open Files Limit + +* To avoid "too many open files" errors: + +```bash +# Check current limit +ulimit -n +# Temporarily set +ulimit -n 65535 +# Permanently set +echo "* soft nofile 65535" >> /etc/security/limits.conf +echo "* hard nofile 65535" >> /etc/security/limits.conf +# Verify after re-login +ulimit -n # Should return 65535 +``` + +### 6.3 How to Disable Swap and Why +* Why Disable: +IoTDB performance degrades when using swap. + +* Steps: + +```bash +# Disable swap +echo "vm.swappiness = 0" >> /etc/sysctl.conf +# Clear swap data and reload +swapoff -a && swapon -a +# Apply settings without reboot +sysctl -p +# Verify swap is 0 +free -m +``` \ No newline at end of file diff --git a/src/UserGuide/V1.3.x/Tools-System/Health-Check-Tool.md b/src/UserGuide/V1.3.x/Tools-System/Health-Check-Tool.md new file mode 100644 index 000000000..4db2655b7 --- /dev/null +++ b/src/UserGuide/V1.3.x/Tools-System/Health-Check-Tool.md @@ -0,0 +1,214 @@ + + +# Health Check Tool + +## 1. Overview +The IoTDB Health Check Tool is designed to inspect the runtime environment of IoTDB nodes. It assists users in verifying the node's environment both before deployment and during operation, providing detailed inspection reports. + +> IoTDB version requirement: Must not be lower than v1.3.2 + +## 2. Prerequisites + +Linux Systems + +* `nc` (netcat) tool: Installed by default; user must have execution permissions. +* `lsof` or `netstat`: At least one must be installed; user must have execution permissions. + +> To verify tool installation: +> +>Check `nc`: `nc -h` +> +>Check `lsof`: `lsof -v` + +Windows Systems + +* PowerShell: Enabled by default. + +## 3. Inspection Items +* Check port occupancy on the node's server (Windows/Linux). +* Verify port connectivity between the current node and other cluster nodes (Windows/Linux). +* Check JDK installation (JAVA_HOME) (Windows/Linux). +* Inspect system memory allocation and IoTDB memory configuration (Windows/Linux). +* Validate directory access permissions (Windows/Linux). +* Ensure the system's maximum number of open files meets requirements (≥ 65535) (Linux only). +* Confirm swap is disabled (Windows/Linux). + +## 4. Usage Instructions +### 4.1 Command Format +```bash +health_check.sh/health_check.bat -ips -o +``` +### 4.2 Parameter Descriptions + +|**Parameter** |**Description** | ​**Required** | +| --------------------- | --------------------------------------------------------------------------------------------------------------------- | ---------------------- | +| `-ips` | Remote server IPs and ports. Supports multiple servers. Format: `ip port1 port2, ip2 port2-1 port2-2` | Optional | +| `-o` | Scope of check: `local` (local machine), `remote` (remote server ports), `all` (both). Default: `all` | Optional | + + +## 5. Usage Examples +### 5.1 Example 1: Check All +```bash + health_check.sh/health_check.bat -ips 172.20.31.19 6667 18080,10.0.6.230 10311 +``` + +Output: + +```bash +Check: Installation Environment(JDK) +Requirement: JDK Version >=1.8 +Result: JDK Version 11.0.21 + +Check: Installation Environment(Memory) +Requirement: Allocate sufficient memory for IoTDB +Result: Total Memory 7.8Gi, 2.33 G allocated to IoTDB ConfigNode, 3.88 G allocated to IoTDB DataNode + +Check: Installation Environment(Directory Access) +Requirement: IoTDB needs write permissions for data/datanode/data, data/datanode/consensus, data/datanode/system, data/datanode/wal, data/confignode/system, data/confignode/consensus, ext/pipe, ext/udf, ext/trigger. +Result: +data/datanode/data has write permission +data/datanode/consensus has write permission +data/datanode/system has write permission +data/datanode/wal has write permission +data/confignode/system has write permission +data/confignode/consensus has write permission +ext/pipe has write permission +ext/udf has write permission +ext/trigger has write permission + +Check: Network(Local Port) +Requirement: Ports 16668, 10730, 11742, 10750, 10760, 10710, 10720 must be unoccupied +Result: +Ports 16668, 10730, 11742, 10750, 10760, 10710, 10720 are free + +Check: Network(Remote Port Connectivity) +Requirement: 172.20.31.19:6667, 18080 and 10.0.6.230:10311 must be accessible +Result: +Inaccessible server ports: +IP: 10.0.6.230, Ports: 10311 + +Check: System Settings(Maximum Open Files Number) +Requirement: >= 65535 +Result: 65535 + +Check: System Settings(Swap) +Requirement: Disabled +Result: Disabled. +``` + +### 5.2 Example 2: Local Check + +```bash +health_check.sh/health_check.bat -o local +``` + +Output: + +```bash +Check: Installation Environment(JDK) +Requirement: JDK Version >=1.8 +Result: JDK Version 11.0.21 + +Check: Installation Environment(Memory) +Requirement: Allocate sufficient memory for IoTDB +Result: Total Memory 7.8Gi, 2.33 G allocated to IoTDB ConfigNode, 3.88 G allocated to IoTDB DataNode + +Check: Installation Environment(Directory Access) +Requirement: IoTDB needs data/datanode/data,data/datanode/consensus,data/datanode/system,data/datanode/wal,data/confignode/system,data/confignode/consensus,ext/pipe,ext/udf,ext/trigger write permission. +Result: +data/datanode/data has write permission +data/datanode/consensus has write permission +data/datanode/system has write permission +data/datanode/wal has write permission +data/confignode/system has write permission +data/confignode/consensus has write permission +ext/pipe has write permission +ext/udf has write permission +ext/trigger has write permission + +Check: Network(Local Port) +Requirement: Port 16668 10730 11742 10750 10760 10710 10720 is not occupied +Result: +Port 16668 10730 11742 10750 10760 10710 10720 is free + +Check: System Settings(Maximum Open Files Number) +Requirement: >= 65535 +Result: 65535 + +Check: System Settings(Swap) +Requirement: disabled +Result: disabled. +``` + +### 5.3 Example 3: Remote Check +```bash +health_check.sh/health_check.bat -o remote -ips 172.20.31.19 6667 18080,10.0.6.230 10311 +``` + +Output: + +```bash +Check: Network(Remote Port Connectivity) +Requirement: 172.20.31.19:6667, 18080 and 10.0.6.230:10311 must be accessible +Result: +Inaccessible server ports: +IP: 10.0.6.230, Ports: 10311 +``` + +## 6. FAQs +### 6.1 How to Adjust Memory Allocation + +* Modify MEMORY\_SIZE in `confignode-env.sh`. +* Modify MEMORY\_SIZE in `datanode-env.sh`. + +### 6.2 How to Modify Max Open Files Limit + +* To avoid "too many open files" errors: + +```bash +# Check current limit +ulimit -n +# Temporarily set +ulimit -n 65535 +# Permanently set +echo "* soft nofile 65535" >> /etc/security/limits.conf +echo "* hard nofile 65535" >> /etc/security/limits.conf +# Verify after re-login +ulimit -n # Should return 65535 +``` + +### 6.3 How to Disable Swap and Why +* Why Disable: +IoTDB performance degrades when using swap. + +* Steps: + +```bash +# Disable swap +echo "vm.swappiness = 0" >> /etc/sysctl.conf +# Clear swap data and reload +swapoff -a && swapon -a +# Apply settings without reboot +sysctl -p +# Verify swap is 0 +free -m +``` \ No newline at end of file diff --git a/src/UserGuide/latest/Tools-System/Health-Check-Tool.md b/src/UserGuide/latest/Tools-System/Health-Check-Tool.md new file mode 100644 index 000000000..312664b15 --- /dev/null +++ b/src/UserGuide/latest/Tools-System/Health-Check-Tool.md @@ -0,0 +1,213 @@ + + +# Health Check Tool + +## 1. Overview +The IoTDB Health Check Tool is designed to inspect the runtime environment of IoTDB nodes. It assists users in verifying the node's environment both before deployment and during operation, providing detailed inspection reports. + + +## 2. Prerequisites + +Linux Systems + +* `nc` (netcat) tool: Installed by default; user must have execution permissions. +* `lsof` or `netstat`: At least one must be installed; user must have execution permissions. + +> To verify tool installation: +> +>Check `nc`: `nc -h` +> +>Check `lsof`: `lsof -v` + +Windows Systems + +* PowerShell: Enabled by default. + +## 3. Inspection Items +* Check port occupancy on the node's server (Windows/Linux). +* Verify port connectivity between the current node and other cluster nodes (Windows/Linux). +* Check JDK installation (JAVA_HOME) (Windows/Linux). +* Inspect system memory allocation and IoTDB memory configuration (Windows/Linux). +* Validate directory access permissions (Windows/Linux). +* Ensure the system's maximum number of open files meets requirements (≥ 65535) (Linux only). +* Confirm swap is disabled (Windows/Linux). + +## 4. Usage Instructions +### 4.1 Command Format +```bash +health_check.sh/health_check.bat -ips -o +``` +### 4.2 Parameter Descriptions + +|**Parameter** |**Description** | ​**Required** | +| --------------------- | --------------------------------------------------------------------------------------------------------------------- | ---------------------- | +| `-ips` | Remote server IPs and ports. Supports multiple servers. Format: `ip port1 port2, ip2 port2-1 port2-2` | Optional | +| `-o` | Scope of check: `local` (local machine), `remote` (remote server ports), `all` (both). Default: `all` | Optional | + + +## 5. Usage Examples +### 5.1 Example 1: Check All +```bash + health_check.sh/health_check.bat -ips 172.20.31.19 6667 18080,10.0.6.230 10311 +``` + +Output: + +```bash +Check: Installation Environment(JDK) +Requirement: JDK Version >=1.8 +Result: JDK Version 11.0.21 + +Check: Installation Environment(Memory) +Requirement: Allocate sufficient memory for IoTDB +Result: Total Memory 7.8Gi, 2.33 G allocated to IoTDB ConfigNode, 3.88 G allocated to IoTDB DataNode + +Check: Installation Environment(Directory Access) +Requirement: IoTDB needs write permissions for data/datanode/data, data/datanode/consensus, data/datanode/system, data/datanode/wal, data/confignode/system, data/confignode/consensus, ext/pipe, ext/udf, ext/trigger. +Result: +data/datanode/data has write permission +data/datanode/consensus has write permission +data/datanode/system has write permission +data/datanode/wal has write permission +data/confignode/system has write permission +data/confignode/consensus has write permission +ext/pipe has write permission +ext/udf has write permission +ext/trigger has write permission + +Check: Network(Local Port) +Requirement: Ports 16668, 10730, 11742, 10750, 10760, 10710, 10720 must be unoccupied +Result: +Ports 16668, 10730, 11742, 10750, 10760, 10710, 10720 are free + +Check: Network(Remote Port Connectivity) +Requirement: 172.20.31.19:6667, 18080 and 10.0.6.230:10311 must be accessible +Result: +Inaccessible server ports: +IP: 10.0.6.230, Ports: 10311 + +Check: System Settings(Maximum Open Files Number) +Requirement: >= 65535 +Result: 65535 + +Check: System Settings(Swap) +Requirement: Disabled +Result: Disabled. +``` + +### 5.2 Example 2: Local Check + +```bash +health_check.sh/health_check.bat -o local +``` + +Output: + +```bash +Check: Installation Environment(JDK) +Requirement: JDK Version >=1.8 +Result: JDK Version 11.0.21 + +Check: Installation Environment(Memory) +Requirement: Allocate sufficient memory for IoTDB +Result: Total Memory 7.8Gi, 2.33 G allocated to IoTDB ConfigNode, 3.88 G allocated to IoTDB DataNode + +Check: Installation Environment(Directory Access) +Requirement: IoTDB needs data/datanode/data,data/datanode/consensus,data/datanode/system,data/datanode/wal,data/confignode/system,data/confignode/consensus,ext/pipe,ext/udf,ext/trigger write permission. +Result: +data/datanode/data has write permission +data/datanode/consensus has write permission +data/datanode/system has write permission +data/datanode/wal has write permission +data/confignode/system has write permission +data/confignode/consensus has write permission +ext/pipe has write permission +ext/udf has write permission +ext/trigger has write permission + +Check: Network(Local Port) +Requirement: Port 16668 10730 11742 10750 10760 10710 10720 is not occupied +Result: +Port 16668 10730 11742 10750 10760 10710 10720 is free + +Check: System Settings(Maximum Open Files Number) +Requirement: >= 65535 +Result: 65535 + +Check: System Settings(Swap) +Requirement: disabled +Result: disabled. +``` + +### 5.3 Example 3: Remote Check +```bash +health_check.sh/health_check.bat -o remote -ips 172.20.31.19 6667 18080,10.0.6.230 10311 +``` + +Output: + +```bash +Check: Network(Remote Port Connectivity) +Requirement: 172.20.31.19:6667, 18080 and 10.0.6.230:10311 must be accessible +Result: +Inaccessible server ports: +IP: 10.0.6.230, Ports: 10311 +``` + +## 6. FAQs +### 6.1 How to Adjust Memory Allocation + +* Modify MEMORY\_SIZE in `confignode-env.sh`. +* Modify MEMORY\_SIZE in `datanode-env.sh`. + +### 6.2 How to Modify Max Open Files Limit + +* To avoid "too many open files" errors: + +```bash +# Check current limit +ulimit -n +# Temporarily set +ulimit -n 65535 +# Permanently set +echo "* soft nofile 65535" >> /etc/security/limits.conf +echo "* hard nofile 65535" >> /etc/security/limits.conf +# Verify after re-login +ulimit -n # Should return 65535 +``` + +### 6.3 How to Disable Swap and Why +* Why Disable: +IoTDB performance degrades when using swap. + +* Steps: + +```bash +# Disable swap +echo "vm.swappiness = 0" >> /etc/sysctl.conf +# Clear swap data and reload +swapoff -a && swapon -a +# Apply settings without reboot +sysctl -p +# Verify swap is 0 +free -m +``` \ No newline at end of file diff --git a/src/zh/UserGuide/Master/Tree/Tools-System/Health-Check-Tool.md b/src/zh/UserGuide/Master/Tree/Tools-System/Health-Check-Tool.md new file mode 100644 index 000000000..cebcd1d90 --- /dev/null +++ b/src/zh/UserGuide/Master/Tree/Tools-System/Health-Check-Tool.md @@ -0,0 +1,220 @@ + + +# 健康检查工具 + +## 1. 概述 + +IoTDB 健康检查工具是一个用于检测 IoTDB 节点运行环境的工具。它可以帮助用户在安装部署数据库前或运行期间检查节点的运行环境,并获取详细的检查结果。 + + +## 2. 前置要求 + +Linux 系统 + +* `nc`(netcat)工具:默认已安装,用户需要有权限执行。 +* `lsof` 或 `netstat`:至少安装其中一个,用户需要有权限执行。 + +> 检查相应工具是否已安装: +> +> 检查 `nc` 是否安装:`nc -h` +> +> 检查 `lsof` 是否安装:`lsof -v` + +Windows 系统 + +* PowerShell:默认已启动。 + +## 3. 检查项 + +* 检查节点所在服务器的端口占用情况(windows/linux) +* 检查当前节点与集群中其他节点的端口连通性(windows/linux) +* 检查系统中是否安装了 JDK(java\_home)(windows/linux) +* 检查系统内存分配情况,检查 IoTDB 内存分配情况(windows/linux) +* 检查目录访问权限(windows/linux) +* 检查系统最大打开文件数是否满足要求(>= 65535)(仅 linux) +* 检查系统是否禁用了 swap(windows/linux) + +## 4. 使用方法 + +### 4.1 命令格式 + +```Bash +health_check.sh/health_check.bat -ips<远程服务器IP+端口> , -o +``` + +### 4.2 参数说明 + +| **参数** | **说明** | **是否必填** | +| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | +| `-ips` | 远程服务器 IP 和端口,支持检查多个服务器,格式如下:`ip port1 port2,ip2 port2-1 port2-2` | 非必填 | +| `-o` | 检查参数,可选值为`local`(本机检查)、`remote`(远程服务器端口连接性检查)、`all`(本机和远程服务器端口一起检查),默认值为`all` | 非必填 | + +## 5. 使用方法 + +### 5.1 示例 1:检查全部 + +```Bash +health_check.sh/health_check.bat -ips 172.20.31.19 6667 18080,10.0.6.230 10311 +``` + +输出结果: + +```Bash +Check: Installation Environment(JDK) +Requirement: JDK Version >=1.8 +Result: JDK Version 11.0.21 + +Check: Installation Environment(Memory) +Requirement: Allocate sufficient memory for IoTDB +Result: Total Memory 7.8Gi, 2.33 G allocated to IoTDB ConfigNode, 3.88 G allocated to IoTDB DataNode + +Check: Installation Environment(Directory Access) +Requirement: IoTDB needs data/datanode/data,data/datanode/consensus,data/datanode/system,data/datanode/wal,data/confignode/system,data/confignode/consensus,ext/pipe,ext/udf,ext/trigger write permission. +Result: +data/datanode/data has write permission +data/datanode/consensus has write permission +data/datanode/system has write permission +data/datanode/wal has write permission +data/confignode/system has write permission +data/confignode/consensus has write permission +ext/pipe has write permission +ext/udf has write permission +ext/trigger has write permission + +Check: Network(Local Port) +Requirement: Port 16668 10730 11742 10750 10760 10710 10720 is not occupied +Result: +Port 16668 10730 11742 10750 10760 10710 10720 is free + +Check: Network(Remote Port Connectivity) +Requirement: 172.20.31.19:6667 18080 ,10.0.6.230:10311 need to be accessible +Result: +The following server ports are inaccessible: +IP: 10.0.6.230, Ports: 10311 + +Check: System Settings(Maximum Open Files Number) +Requirement: >= 65535 +Result: 65535 + +Check: System Settings(Swap) +Requirement: disabled +Result: disabled. +``` + +### 5.2 示例 2:检查本机 + +```Bash +health_check.sh/health_check.bat -o local +``` + +输出结果: + +```Bash +Check: Installation Environment(JDK) +Requirement: JDK Version >=1.8 +Result: JDK Version 11.0.21 + +Check: Installation Environment(Memory) +Requirement: Allocate sufficient memory for IoTDB +Result: Total Memory 7.8Gi, 2.33 G allocated to IoTDB ConfigNode, 3.88 G allocated to IoTDB DataNode + +Check: Installation Environment(Directory Access) +Requirement: IoTDB needs data/datanode/data,data/datanode/consensus,data/datanode/system,data/datanode/wal,data/confignode/system,data/confignode/consensus,ext/pipe,ext/udf,ext/trigger write permission. +Result: +data/datanode/data has write permission +data/datanode/consensus has write permission +data/datanode/system has write permission +data/datanode/wal has write permission +data/confignode/system has write permission +data/confignode/consensus has write permission +ext/pipe has write permission +ext/udf has write permission +ext/trigger has write permission + +Check: Network(Local Port) +Requirement: Port 16668 10730 11742 10750 10760 10710 10720 is not occupied +Result: +Port 16668 10730 11742 10750 10760 10710 10720 is free + +Check: System Settings(Maximum Open Files Number) +Requirement: >= 65535 +Result: 65535 + +Check: System Settings(Swap) +Requirement: disabled +Result: disabled. +``` + +### 5.3 示例 3:检查远程 + +```Bash +health_check.sh/health_check.bat -o remote -ips 172.20.31.19 6667 18080,10.0.6.230 10311 +``` + +输出结果: + +```Bash +Check: Network(Remote Port Connectivity) +Requirement: 172.20.31.19:6667 18080 ,10.0.6.230:10311 need to be accessible +Result: +The following server ports are inaccessible: +IP: 10.0.6.230, Ports: 10311 +``` + +## 6. 常见问题 + +### 6.1 如何调整内存分配 + +* 修改`confignode-env.sh`中的MEMORY\_SIZE +* 修改`datanode-env.sh`中的MEMORY\_SIZE + +### 6.2 如何修改最大打开数文件 + +* 设置系统最大打开文件数为 65535,以避免出现 "太多的打开文件 "的错误。 + +```Bash +#查看当前限制 +ulimit -n +# 临时修改 +ulimit -n 65535 +# 永久修改 +echo "* soft nofile 65535" >> /etc/security/limits.conf +echo "* hard nofile 65535" >> /etc/security/limits.conf +#退出当前终端会话后查看,预期显示65535 +ulimit -n +``` + +### 6.3 如何禁用 Swap 及禁用原因 + +* 禁用原因:IoTDB 使用 Swap 会导致性能下降,建议禁用。 +* 禁用方式: + +```Bash +echo "vm.swappiness = 0">> /etc/sysctl.conf +# 一起执行 swapoff -a 和 swapon -a 命令是为了将 swap 里的数据转储回内存,并清空 swap 里的数据。 +# 不可省略 swappiness 设置而只执行 swapoff -a;否则,重启后 swap 会再次自动打开,使得操作失效。 +swapoff -a && swapon -a +# 在不重启的情况下使配置生效。 +sysctl -p +# 检查内存分配,预期 swap 为 0 +free -m +``` diff --git a/src/zh/UserGuide/V1.3.x/Tools-System/Health-Check-Tool.md b/src/zh/UserGuide/V1.3.x/Tools-System/Health-Check-Tool.md new file mode 100644 index 000000000..0c1d38e2a --- /dev/null +++ b/src/zh/UserGuide/V1.3.x/Tools-System/Health-Check-Tool.md @@ -0,0 +1,221 @@ + + +# 健康检查工具 + +## 1. 概述 + +IoTDB 健康检查工具是一个用于检测 IoTDB 节点运行环境的工具。它可以帮助用户在安装部署数据库前或运行期间检查节点的运行环境,并获取详细的检查结果。 + +> IoTDB版本要求:不能低于v1.3.2 + +## 2. 前置要求 + +Linux 系统 + +* `nc`(netcat)工具:默认已安装,用户需要有权限执行。 +* `lsof` 或 `netstat`:至少安装其中一个,用户需要有权限执行。 + +> 检查相应工具是否已安装: +> +> 检查 `nc` 是否安装:`nc -h` +> +> 检查 `lsof` 是否安装:`lsof -v` + +Windows 系统 + +* PowerShell:默认已启动。 + +## 3. 检查项 + +* 检查节点所在服务器的端口占用情况(windows/linux) +* 检查当前节点与集群中其他节点的端口连通性(windows/linux) +* 检查系统中是否安装了 JDK(java\_home)(windows/linux) +* 检查系统内存分配情况,检查 IoTDB 内存分配情况(windows/linux) +* 检查目录访问权限(windows/linux) +* 检查系统最大打开文件数是否满足要求(>= 65535)(仅 linux) +* 检查系统是否禁用了 swap(windows/linux) + +## 4. 使用方法 + +### 4.1 命令格式 + +```Bash +health_check.sh/health_check.bat -ips<远程服务器IP+端口> , -o +``` + +### 4.2 参数说明 + +| **参数** | **说明** | **是否必填** | +| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | +| `-ips` | 远程服务器 IP 和端口,支持检查多个服务器,格式如下:`ip port1 port2,ip2 port2-1 port2-2` | 非必填 | +| `-o` | 检查参数,可选值为`local`(本机检查)、`remote`(远程服务器端口连接性检查)、`all`(本机和远程服务器端口一起检查),默认值为`all` | 非必填 | + +## 5. 使用方法 + +### 5.1 示例 1:检查全部 + +```Bash +health_check.sh/health_check.bat -ips 172.20.31.19 6667 18080,10.0.6.230 10311 +``` + +输出结果: + +```Bash +Check: Installation Environment(JDK) +Requirement: JDK Version >=1.8 +Result: JDK Version 11.0.21 + +Check: Installation Environment(Memory) +Requirement: Allocate sufficient memory for IoTDB +Result: Total Memory 7.8Gi, 2.33 G allocated to IoTDB ConfigNode, 3.88 G allocated to IoTDB DataNode + +Check: Installation Environment(Directory Access) +Requirement: IoTDB needs data/datanode/data,data/datanode/consensus,data/datanode/system,data/datanode/wal,data/confignode/system,data/confignode/consensus,ext/pipe,ext/udf,ext/trigger write permission. +Result: +data/datanode/data has write permission +data/datanode/consensus has write permission +data/datanode/system has write permission +data/datanode/wal has write permission +data/confignode/system has write permission +data/confignode/consensus has write permission +ext/pipe has write permission +ext/udf has write permission +ext/trigger has write permission + +Check: Network(Local Port) +Requirement: Port 16668 10730 11742 10750 10760 10710 10720 is not occupied +Result: +Port 16668 10730 11742 10750 10760 10710 10720 is free + +Check: Network(Remote Port Connectivity) +Requirement: 172.20.31.19:6667 18080 ,10.0.6.230:10311 need to be accessible +Result: +The following server ports are inaccessible: +IP: 10.0.6.230, Ports: 10311 + +Check: System Settings(Maximum Open Files Number) +Requirement: >= 65535 +Result: 65535 + +Check: System Settings(Swap) +Requirement: disabled +Result: disabled. +``` + +### 5.2 示例 2:检查本机 + +```Bash +health_check.sh/health_check.bat -o local +``` + +输出结果: + +```Bash +Check: Installation Environment(JDK) +Requirement: JDK Version >=1.8 +Result: JDK Version 11.0.21 + +Check: Installation Environment(Memory) +Requirement: Allocate sufficient memory for IoTDB +Result: Total Memory 7.8Gi, 2.33 G allocated to IoTDB ConfigNode, 3.88 G allocated to IoTDB DataNode + +Check: Installation Environment(Directory Access) +Requirement: IoTDB needs data/datanode/data,data/datanode/consensus,data/datanode/system,data/datanode/wal,data/confignode/system,data/confignode/consensus,ext/pipe,ext/udf,ext/trigger write permission. +Result: +data/datanode/data has write permission +data/datanode/consensus has write permission +data/datanode/system has write permission +data/datanode/wal has write permission +data/confignode/system has write permission +data/confignode/consensus has write permission +ext/pipe has write permission +ext/udf has write permission +ext/trigger has write permission + +Check: Network(Local Port) +Requirement: Port 16668 10730 11742 10750 10760 10710 10720 is not occupied +Result: +Port 16668 10730 11742 10750 10760 10710 10720 is free + +Check: System Settings(Maximum Open Files Number) +Requirement: >= 65535 +Result: 65535 + +Check: System Settings(Swap) +Requirement: disabled +Result: disabled. +``` + +### 5.3 示例 3:检查远程 + +```Bash +health_check.sh/health_check.bat -o remote -ips 172.20.31.19 6667 18080,10.0.6.230 10311 +``` + +输出结果: + +```Bash +Check: Network(Remote Port Connectivity) +Requirement: 172.20.31.19:6667 18080 ,10.0.6.230:10311 need to be accessible +Result: +The following server ports are inaccessible: +IP: 10.0.6.230, Ports: 10311 +``` + +## 6. 常见问题 + +### 6.1 如何调整内存分配 + +* 修改`confignode-env.sh`中的MEMORY\_SIZE +* 修改`datanode-env.sh`中的MEMORY\_SIZE + +### 6.2 如何修改最大打开数文件 + +* 设置系统最大打开文件数为 65535,以避免出现 "太多的打开文件 "的错误。 + +```Bash +#查看当前限制 +ulimit -n +# 临时修改 +ulimit -n 65535 +# 永久修改 +echo "* soft nofile 65535" >> /etc/security/limits.conf +echo "* hard nofile 65535" >> /etc/security/limits.conf +#退出当前终端会话后查看,预期显示65535 +ulimit -n +``` + +### 6.3 如何禁用 Swap 及禁用原因 + +* 禁用原因:IoTDB 使用 Swap 会导致性能下降,建议禁用。 +* 禁用方式: + +```Bash +echo "vm.swappiness = 0">> /etc/sysctl.conf +# 一起执行 swapoff -a 和 swapon -a 命令是为了将 swap 里的数据转储回内存,并清空 swap 里的数据。 +# 不可省略 swappiness 设置而只执行 swapoff -a;否则,重启后 swap 会再次自动打开,使得操作失效。 +swapoff -a && swapon -a +# 在不重启的情况下使配置生效。 +sysctl -p +# 检查内存分配,预期 swap 为 0 +free -m +``` diff --git a/src/zh/UserGuide/latest/Tools-System/Health-Check-Tool.md b/src/zh/UserGuide/latest/Tools-System/Health-Check-Tool.md new file mode 100644 index 000000000..cebcd1d90 --- /dev/null +++ b/src/zh/UserGuide/latest/Tools-System/Health-Check-Tool.md @@ -0,0 +1,220 @@ + + +# 健康检查工具 + +## 1. 概述 + +IoTDB 健康检查工具是一个用于检测 IoTDB 节点运行环境的工具。它可以帮助用户在安装部署数据库前或运行期间检查节点的运行环境,并获取详细的检查结果。 + + +## 2. 前置要求 + +Linux 系统 + +* `nc`(netcat)工具:默认已安装,用户需要有权限执行。 +* `lsof` 或 `netstat`:至少安装其中一个,用户需要有权限执行。 + +> 检查相应工具是否已安装: +> +> 检查 `nc` 是否安装:`nc -h` +> +> 检查 `lsof` 是否安装:`lsof -v` + +Windows 系统 + +* PowerShell:默认已启动。 + +## 3. 检查项 + +* 检查节点所在服务器的端口占用情况(windows/linux) +* 检查当前节点与集群中其他节点的端口连通性(windows/linux) +* 检查系统中是否安装了 JDK(java\_home)(windows/linux) +* 检查系统内存分配情况,检查 IoTDB 内存分配情况(windows/linux) +* 检查目录访问权限(windows/linux) +* 检查系统最大打开文件数是否满足要求(>= 65535)(仅 linux) +* 检查系统是否禁用了 swap(windows/linux) + +## 4. 使用方法 + +### 4.1 命令格式 + +```Bash +health_check.sh/health_check.bat -ips<远程服务器IP+端口> , -o +``` + +### 4.2 参数说明 + +| **参数** | **说明** | **是否必填** | +| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | +| `-ips` | 远程服务器 IP 和端口,支持检查多个服务器,格式如下:`ip port1 port2,ip2 port2-1 port2-2` | 非必填 | +| `-o` | 检查参数,可选值为`local`(本机检查)、`remote`(远程服务器端口连接性检查)、`all`(本机和远程服务器端口一起检查),默认值为`all` | 非必填 | + +## 5. 使用方法 + +### 5.1 示例 1:检查全部 + +```Bash +health_check.sh/health_check.bat -ips 172.20.31.19 6667 18080,10.0.6.230 10311 +``` + +输出结果: + +```Bash +Check: Installation Environment(JDK) +Requirement: JDK Version >=1.8 +Result: JDK Version 11.0.21 + +Check: Installation Environment(Memory) +Requirement: Allocate sufficient memory for IoTDB +Result: Total Memory 7.8Gi, 2.33 G allocated to IoTDB ConfigNode, 3.88 G allocated to IoTDB DataNode + +Check: Installation Environment(Directory Access) +Requirement: IoTDB needs data/datanode/data,data/datanode/consensus,data/datanode/system,data/datanode/wal,data/confignode/system,data/confignode/consensus,ext/pipe,ext/udf,ext/trigger write permission. +Result: +data/datanode/data has write permission +data/datanode/consensus has write permission +data/datanode/system has write permission +data/datanode/wal has write permission +data/confignode/system has write permission +data/confignode/consensus has write permission +ext/pipe has write permission +ext/udf has write permission +ext/trigger has write permission + +Check: Network(Local Port) +Requirement: Port 16668 10730 11742 10750 10760 10710 10720 is not occupied +Result: +Port 16668 10730 11742 10750 10760 10710 10720 is free + +Check: Network(Remote Port Connectivity) +Requirement: 172.20.31.19:6667 18080 ,10.0.6.230:10311 need to be accessible +Result: +The following server ports are inaccessible: +IP: 10.0.6.230, Ports: 10311 + +Check: System Settings(Maximum Open Files Number) +Requirement: >= 65535 +Result: 65535 + +Check: System Settings(Swap) +Requirement: disabled +Result: disabled. +``` + +### 5.2 示例 2:检查本机 + +```Bash +health_check.sh/health_check.bat -o local +``` + +输出结果: + +```Bash +Check: Installation Environment(JDK) +Requirement: JDK Version >=1.8 +Result: JDK Version 11.0.21 + +Check: Installation Environment(Memory) +Requirement: Allocate sufficient memory for IoTDB +Result: Total Memory 7.8Gi, 2.33 G allocated to IoTDB ConfigNode, 3.88 G allocated to IoTDB DataNode + +Check: Installation Environment(Directory Access) +Requirement: IoTDB needs data/datanode/data,data/datanode/consensus,data/datanode/system,data/datanode/wal,data/confignode/system,data/confignode/consensus,ext/pipe,ext/udf,ext/trigger write permission. +Result: +data/datanode/data has write permission +data/datanode/consensus has write permission +data/datanode/system has write permission +data/datanode/wal has write permission +data/confignode/system has write permission +data/confignode/consensus has write permission +ext/pipe has write permission +ext/udf has write permission +ext/trigger has write permission + +Check: Network(Local Port) +Requirement: Port 16668 10730 11742 10750 10760 10710 10720 is not occupied +Result: +Port 16668 10730 11742 10750 10760 10710 10720 is free + +Check: System Settings(Maximum Open Files Number) +Requirement: >= 65535 +Result: 65535 + +Check: System Settings(Swap) +Requirement: disabled +Result: disabled. +``` + +### 5.3 示例 3:检查远程 + +```Bash +health_check.sh/health_check.bat -o remote -ips 172.20.31.19 6667 18080,10.0.6.230 10311 +``` + +输出结果: + +```Bash +Check: Network(Remote Port Connectivity) +Requirement: 172.20.31.19:6667 18080 ,10.0.6.230:10311 need to be accessible +Result: +The following server ports are inaccessible: +IP: 10.0.6.230, Ports: 10311 +``` + +## 6. 常见问题 + +### 6.1 如何调整内存分配 + +* 修改`confignode-env.sh`中的MEMORY\_SIZE +* 修改`datanode-env.sh`中的MEMORY\_SIZE + +### 6.2 如何修改最大打开数文件 + +* 设置系统最大打开文件数为 65535,以避免出现 "太多的打开文件 "的错误。 + +```Bash +#查看当前限制 +ulimit -n +# 临时修改 +ulimit -n 65535 +# 永久修改 +echo "* soft nofile 65535" >> /etc/security/limits.conf +echo "* hard nofile 65535" >> /etc/security/limits.conf +#退出当前终端会话后查看,预期显示65535 +ulimit -n +``` + +### 6.3 如何禁用 Swap 及禁用原因 + +* 禁用原因:IoTDB 使用 Swap 会导致性能下降,建议禁用。 +* 禁用方式: + +```Bash +echo "vm.swappiness = 0">> /etc/sysctl.conf +# 一起执行 swapoff -a 和 swapon -a 命令是为了将 swap 里的数据转储回内存,并清空 swap 里的数据。 +# 不可省略 swappiness 设置而只执行 swapoff -a;否则,重启后 swap 会再次自动打开,使得操作失效。 +swapoff -a && swapon -a +# 在不重启的情况下使配置生效。 +sysctl -p +# 检查内存分配,预期 swap 为 0 +free -m +``` From 029a33ebf2e1a29ac8a7bd32d457b16b35e26d18 Mon Sep 17 00:00:00 2001 From: Leto_b Date: Tue, 11 Mar 2025 18:10:43 +0800 Subject: [PATCH 2/2] add health check tool in dev-1.3 --- .../dev-1.3/Tools-System/Health-Check-Tool.md | 214 +++++++++++++++++ .../dev-1.3/Tools-System/Health-Check-Tool.md | 221 ++++++++++++++++++ 2 files changed, 435 insertions(+) create mode 100644 src/UserGuide/dev-1.3/Tools-System/Health-Check-Tool.md create mode 100644 src/zh/UserGuide/dev-1.3/Tools-System/Health-Check-Tool.md diff --git a/src/UserGuide/dev-1.3/Tools-System/Health-Check-Tool.md b/src/UserGuide/dev-1.3/Tools-System/Health-Check-Tool.md new file mode 100644 index 000000000..4db2655b7 --- /dev/null +++ b/src/UserGuide/dev-1.3/Tools-System/Health-Check-Tool.md @@ -0,0 +1,214 @@ + + +# Health Check Tool + +## 1. Overview +The IoTDB Health Check Tool is designed to inspect the runtime environment of IoTDB nodes. It assists users in verifying the node's environment both before deployment and during operation, providing detailed inspection reports. + +> IoTDB version requirement: Must not be lower than v1.3.2 + +## 2. Prerequisites + +Linux Systems + +* `nc` (netcat) tool: Installed by default; user must have execution permissions. +* `lsof` or `netstat`: At least one must be installed; user must have execution permissions. + +> To verify tool installation: +> +>Check `nc`: `nc -h` +> +>Check `lsof`: `lsof -v` + +Windows Systems + +* PowerShell: Enabled by default. + +## 3. Inspection Items +* Check port occupancy on the node's server (Windows/Linux). +* Verify port connectivity between the current node and other cluster nodes (Windows/Linux). +* Check JDK installation (JAVA_HOME) (Windows/Linux). +* Inspect system memory allocation and IoTDB memory configuration (Windows/Linux). +* Validate directory access permissions (Windows/Linux). +* Ensure the system's maximum number of open files meets requirements (≥ 65535) (Linux only). +* Confirm swap is disabled (Windows/Linux). + +## 4. Usage Instructions +### 4.1 Command Format +```bash +health_check.sh/health_check.bat -ips -o +``` +### 4.2 Parameter Descriptions + +|**Parameter** |**Description** | ​**Required** | +| --------------------- | --------------------------------------------------------------------------------------------------------------------- | ---------------------- | +| `-ips` | Remote server IPs and ports. Supports multiple servers. Format: `ip port1 port2, ip2 port2-1 port2-2` | Optional | +| `-o` | Scope of check: `local` (local machine), `remote` (remote server ports), `all` (both). Default: `all` | Optional | + + +## 5. Usage Examples +### 5.1 Example 1: Check All +```bash + health_check.sh/health_check.bat -ips 172.20.31.19 6667 18080,10.0.6.230 10311 +``` + +Output: + +```bash +Check: Installation Environment(JDK) +Requirement: JDK Version >=1.8 +Result: JDK Version 11.0.21 + +Check: Installation Environment(Memory) +Requirement: Allocate sufficient memory for IoTDB +Result: Total Memory 7.8Gi, 2.33 G allocated to IoTDB ConfigNode, 3.88 G allocated to IoTDB DataNode + +Check: Installation Environment(Directory Access) +Requirement: IoTDB needs write permissions for data/datanode/data, data/datanode/consensus, data/datanode/system, data/datanode/wal, data/confignode/system, data/confignode/consensus, ext/pipe, ext/udf, ext/trigger. +Result: +data/datanode/data has write permission +data/datanode/consensus has write permission +data/datanode/system has write permission +data/datanode/wal has write permission +data/confignode/system has write permission +data/confignode/consensus has write permission +ext/pipe has write permission +ext/udf has write permission +ext/trigger has write permission + +Check: Network(Local Port) +Requirement: Ports 16668, 10730, 11742, 10750, 10760, 10710, 10720 must be unoccupied +Result: +Ports 16668, 10730, 11742, 10750, 10760, 10710, 10720 are free + +Check: Network(Remote Port Connectivity) +Requirement: 172.20.31.19:6667, 18080 and 10.0.6.230:10311 must be accessible +Result: +Inaccessible server ports: +IP: 10.0.6.230, Ports: 10311 + +Check: System Settings(Maximum Open Files Number) +Requirement: >= 65535 +Result: 65535 + +Check: System Settings(Swap) +Requirement: Disabled +Result: Disabled. +``` + +### 5.2 Example 2: Local Check + +```bash +health_check.sh/health_check.bat -o local +``` + +Output: + +```bash +Check: Installation Environment(JDK) +Requirement: JDK Version >=1.8 +Result: JDK Version 11.0.21 + +Check: Installation Environment(Memory) +Requirement: Allocate sufficient memory for IoTDB +Result: Total Memory 7.8Gi, 2.33 G allocated to IoTDB ConfigNode, 3.88 G allocated to IoTDB DataNode + +Check: Installation Environment(Directory Access) +Requirement: IoTDB needs data/datanode/data,data/datanode/consensus,data/datanode/system,data/datanode/wal,data/confignode/system,data/confignode/consensus,ext/pipe,ext/udf,ext/trigger write permission. +Result: +data/datanode/data has write permission +data/datanode/consensus has write permission +data/datanode/system has write permission +data/datanode/wal has write permission +data/confignode/system has write permission +data/confignode/consensus has write permission +ext/pipe has write permission +ext/udf has write permission +ext/trigger has write permission + +Check: Network(Local Port) +Requirement: Port 16668 10730 11742 10750 10760 10710 10720 is not occupied +Result: +Port 16668 10730 11742 10750 10760 10710 10720 is free + +Check: System Settings(Maximum Open Files Number) +Requirement: >= 65535 +Result: 65535 + +Check: System Settings(Swap) +Requirement: disabled +Result: disabled. +``` + +### 5.3 Example 3: Remote Check +```bash +health_check.sh/health_check.bat -o remote -ips 172.20.31.19 6667 18080,10.0.6.230 10311 +``` + +Output: + +```bash +Check: Network(Remote Port Connectivity) +Requirement: 172.20.31.19:6667, 18080 and 10.0.6.230:10311 must be accessible +Result: +Inaccessible server ports: +IP: 10.0.6.230, Ports: 10311 +``` + +## 6. FAQs +### 6.1 How to Adjust Memory Allocation + +* Modify MEMORY\_SIZE in `confignode-env.sh`. +* Modify MEMORY\_SIZE in `datanode-env.sh`. + +### 6.2 How to Modify Max Open Files Limit + +* To avoid "too many open files" errors: + +```bash +# Check current limit +ulimit -n +# Temporarily set +ulimit -n 65535 +# Permanently set +echo "* soft nofile 65535" >> /etc/security/limits.conf +echo "* hard nofile 65535" >> /etc/security/limits.conf +# Verify after re-login +ulimit -n # Should return 65535 +``` + +### 6.3 How to Disable Swap and Why +* Why Disable: +IoTDB performance degrades when using swap. + +* Steps: + +```bash +# Disable swap +echo "vm.swappiness = 0" >> /etc/sysctl.conf +# Clear swap data and reload +swapoff -a && swapon -a +# Apply settings without reboot +sysctl -p +# Verify swap is 0 +free -m +``` \ No newline at end of file diff --git a/src/zh/UserGuide/dev-1.3/Tools-System/Health-Check-Tool.md b/src/zh/UserGuide/dev-1.3/Tools-System/Health-Check-Tool.md new file mode 100644 index 000000000..0c1d38e2a --- /dev/null +++ b/src/zh/UserGuide/dev-1.3/Tools-System/Health-Check-Tool.md @@ -0,0 +1,221 @@ + + +# 健康检查工具 + +## 1. 概述 + +IoTDB 健康检查工具是一个用于检测 IoTDB 节点运行环境的工具。它可以帮助用户在安装部署数据库前或运行期间检查节点的运行环境,并获取详细的检查结果。 + +> IoTDB版本要求:不能低于v1.3.2 + +## 2. 前置要求 + +Linux 系统 + +* `nc`(netcat)工具:默认已安装,用户需要有权限执行。 +* `lsof` 或 `netstat`:至少安装其中一个,用户需要有权限执行。 + +> 检查相应工具是否已安装: +> +> 检查 `nc` 是否安装:`nc -h` +> +> 检查 `lsof` 是否安装:`lsof -v` + +Windows 系统 + +* PowerShell:默认已启动。 + +## 3. 检查项 + +* 检查节点所在服务器的端口占用情况(windows/linux) +* 检查当前节点与集群中其他节点的端口连通性(windows/linux) +* 检查系统中是否安装了 JDK(java\_home)(windows/linux) +* 检查系统内存分配情况,检查 IoTDB 内存分配情况(windows/linux) +* 检查目录访问权限(windows/linux) +* 检查系统最大打开文件数是否满足要求(>= 65535)(仅 linux) +* 检查系统是否禁用了 swap(windows/linux) + +## 4. 使用方法 + +### 4.1 命令格式 + +```Bash +health_check.sh/health_check.bat -ips<远程服务器IP+端口> , -o +``` + +### 4.2 参数说明 + +| **参数** | **说明** | **是否必填** | +| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | +| `-ips` | 远程服务器 IP 和端口,支持检查多个服务器,格式如下:`ip port1 port2,ip2 port2-1 port2-2` | 非必填 | +| `-o` | 检查参数,可选值为`local`(本机检查)、`remote`(远程服务器端口连接性检查)、`all`(本机和远程服务器端口一起检查),默认值为`all` | 非必填 | + +## 5. 使用方法 + +### 5.1 示例 1:检查全部 + +```Bash +health_check.sh/health_check.bat -ips 172.20.31.19 6667 18080,10.0.6.230 10311 +``` + +输出结果: + +```Bash +Check: Installation Environment(JDK) +Requirement: JDK Version >=1.8 +Result: JDK Version 11.0.21 + +Check: Installation Environment(Memory) +Requirement: Allocate sufficient memory for IoTDB +Result: Total Memory 7.8Gi, 2.33 G allocated to IoTDB ConfigNode, 3.88 G allocated to IoTDB DataNode + +Check: Installation Environment(Directory Access) +Requirement: IoTDB needs data/datanode/data,data/datanode/consensus,data/datanode/system,data/datanode/wal,data/confignode/system,data/confignode/consensus,ext/pipe,ext/udf,ext/trigger write permission. +Result: +data/datanode/data has write permission +data/datanode/consensus has write permission +data/datanode/system has write permission +data/datanode/wal has write permission +data/confignode/system has write permission +data/confignode/consensus has write permission +ext/pipe has write permission +ext/udf has write permission +ext/trigger has write permission + +Check: Network(Local Port) +Requirement: Port 16668 10730 11742 10750 10760 10710 10720 is not occupied +Result: +Port 16668 10730 11742 10750 10760 10710 10720 is free + +Check: Network(Remote Port Connectivity) +Requirement: 172.20.31.19:6667 18080 ,10.0.6.230:10311 need to be accessible +Result: +The following server ports are inaccessible: +IP: 10.0.6.230, Ports: 10311 + +Check: System Settings(Maximum Open Files Number) +Requirement: >= 65535 +Result: 65535 + +Check: System Settings(Swap) +Requirement: disabled +Result: disabled. +``` + +### 5.2 示例 2:检查本机 + +```Bash +health_check.sh/health_check.bat -o local +``` + +输出结果: + +```Bash +Check: Installation Environment(JDK) +Requirement: JDK Version >=1.8 +Result: JDK Version 11.0.21 + +Check: Installation Environment(Memory) +Requirement: Allocate sufficient memory for IoTDB +Result: Total Memory 7.8Gi, 2.33 G allocated to IoTDB ConfigNode, 3.88 G allocated to IoTDB DataNode + +Check: Installation Environment(Directory Access) +Requirement: IoTDB needs data/datanode/data,data/datanode/consensus,data/datanode/system,data/datanode/wal,data/confignode/system,data/confignode/consensus,ext/pipe,ext/udf,ext/trigger write permission. +Result: +data/datanode/data has write permission +data/datanode/consensus has write permission +data/datanode/system has write permission +data/datanode/wal has write permission +data/confignode/system has write permission +data/confignode/consensus has write permission +ext/pipe has write permission +ext/udf has write permission +ext/trigger has write permission + +Check: Network(Local Port) +Requirement: Port 16668 10730 11742 10750 10760 10710 10720 is not occupied +Result: +Port 16668 10730 11742 10750 10760 10710 10720 is free + +Check: System Settings(Maximum Open Files Number) +Requirement: >= 65535 +Result: 65535 + +Check: System Settings(Swap) +Requirement: disabled +Result: disabled. +``` + +### 5.3 示例 3:检查远程 + +```Bash +health_check.sh/health_check.bat -o remote -ips 172.20.31.19 6667 18080,10.0.6.230 10311 +``` + +输出结果: + +```Bash +Check: Network(Remote Port Connectivity) +Requirement: 172.20.31.19:6667 18080 ,10.0.6.230:10311 need to be accessible +Result: +The following server ports are inaccessible: +IP: 10.0.6.230, Ports: 10311 +``` + +## 6. 常见问题 + +### 6.1 如何调整内存分配 + +* 修改`confignode-env.sh`中的MEMORY\_SIZE +* 修改`datanode-env.sh`中的MEMORY\_SIZE + +### 6.2 如何修改最大打开数文件 + +* 设置系统最大打开文件数为 65535,以避免出现 "太多的打开文件 "的错误。 + +```Bash +#查看当前限制 +ulimit -n +# 临时修改 +ulimit -n 65535 +# 永久修改 +echo "* soft nofile 65535" >> /etc/security/limits.conf +echo "* hard nofile 65535" >> /etc/security/limits.conf +#退出当前终端会话后查看,预期显示65535 +ulimit -n +``` + +### 6.3 如何禁用 Swap 及禁用原因 + +* 禁用原因:IoTDB 使用 Swap 会导致性能下降,建议禁用。 +* 禁用方式: + +```Bash +echo "vm.swappiness = 0">> /etc/sysctl.conf +# 一起执行 swapoff -a 和 swapon -a 命令是为了将 swap 里的数据转储回内存,并清空 swap 里的数据。 +# 不可省略 swappiness 设置而只执行 swapoff -a;否则,重启后 swap 会再次自动打开,使得操作失效。 +swapoff -a && swapon -a +# 在不重启的情况下使配置生效。 +sysctl -p +# 检查内存分配,预期 swap 为 0 +free -m +```