Compare commits
4 Commits
de6c14d387
...
fd22eab9b0
Author | SHA1 | Date |
---|---|---|
![]() |
fd22eab9b0 | |
![]() |
724c86b76d | |
![]() |
6081db542d | |
![]() |
3e1076c9fd |
|
@ -0,0 +1,139 @@
|
|||
---
|
||||
sidebar_label: 安装前检查工具
|
||||
title: 安装前检查工具
|
||||
toc_max_heading_level: 4
|
||||
---
|
||||
|
||||
## 背景
|
||||
|
||||
TDengine 的安装部署对环境系统有一定的依赖和要求,安装部署前需要对环境进行安装前检查,提前发现环境问题,本文档旨在说明安装前预配置工具在安装 TDengine 前对环境的预配置内容和工具的使用方法。
|
||||
|
||||
## 安装件检查工具使用方法
|
||||
|
||||
工具支持通过 help 参数查看支持的语法
|
||||
|
||||
```help
|
||||
Usage: taosprecheck [OPTIONS]
|
||||
|
||||
Pre-check for Database installation
|
||||
|
||||
Options:
|
||||
-m, --model [local|ssh] connection model, default: local
|
||||
-f, --config TEXT Full path of test config file [required]
|
||||
-c, --check-perf [only|true|false]
|
||||
check performance of CPU, MEM and IO
|
||||
-b, --backend BOOLEAN Run process in backend. default: False
|
||||
-v, --version Show version
|
||||
--help Show this message and exit.
|
||||
```
|
||||
|
||||
### 参数详细说明
|
||||
|
||||
- `model`:预配置工具运行模式,分为 local 和 ssh。安装环境的多节点间支持 SSH 通信,可选择 ssh 模式,在任意节点上运行预配置工具,会依次对所有节点环境完成预配置操作。反之,节点间不支持 SSH 通信时,可选择 local 模式,仅对工具运行所在机器完成预配置操作,默认为 local 模式。
|
||||
- `config`:预配置工具加载的配置文件,其具体配置方式详见 **配置文件使用说明** 章节。不配置 config 参数时配置文件默认路径为工具运行当前目录。
|
||||
- `check-perf`:是否监测磁盘写入性能,若置为 True 则会基于 perf 或 dd 性能测试工具对环境的磁盘进行简单的写入性能测试并生成测试报告,默认为 False
|
||||
- `backend`:后台运行预配置工具,选择 True 后预配置工具在自动在后台运行,默认为 False。
|
||||
- `version`:打印预配置工具版本信息。
|
||||
|
||||
### 配置文件使用说明
|
||||
|
||||
```config
|
||||
# 安装部署 TDengine 的环境信息,支持免密登录和 SSH 登录两种方式,当环境配置了免密登录后可不用配置 password 信息
|
||||
[test_env]
|
||||
# 节点间通过 SSH 协议访问
|
||||
firstep=192.168.0.1||fqdn=tdengine1||username=root||password=123456||port=22
|
||||
secondep=192.168.0.2||fqdn=tdengine2||username=root||password=123456||port=22
|
||||
dnode3=192.168.0.3||fqdn=tdengine3||username=root||username=123456||port=22
|
||||
|
||||
# 节点间配置免密登录
|
||||
# firstep=192.168.0.1||fqdn=tdengine1||username=root||port=22
|
||||
# secondep=192.168.0.2||fqdn=tdengine2||username=root||port=22
|
||||
# dnode3=192.168.0.3||fqdn=tdengine3||username=root||port=22
|
||||
|
||||
# 系统时区,工具会按照下面配置修改系统时区
|
||||
[timezone]
|
||||
tz=Asia/Shanghai
|
||||
|
||||
# 系统服务状态,工具会按照下面配置关闭对应的系统服务
|
||||
[services]
|
||||
firewall=inactive
|
||||
selinux=inactive
|
||||
|
||||
# coredump 配置,工具会按照下面配置 coredump 的生成路径
|
||||
[coredump]
|
||||
kernel.core_pattern=/data/taos/core/core-%%e-%%p
|
||||
|
||||
# /etc/sysctl.conf 中系统参数,工具会按照下面配置修改系统参数值
|
||||
[sys_vars:/etc/sysctl.conf]
|
||||
fs.nr_open=2147483584
|
||||
fs.file-max=2147483584
|
||||
net.ipv4.ip_local_port_range=10000 65534
|
||||
|
||||
# /etc/security/limits.conf 中系统参数,工具会按照下面配置修改系统参数值
|
||||
[sys_vars:/etc/security/limits.conf]
|
||||
* soft nproc=65536
|
||||
* soft nofile=2147483584
|
||||
* soft stack=65536
|
||||
* hard nproc=65536
|
||||
* hard nofile=2147483584
|
||||
* hard stack=65536
|
||||
root soft nproc=65536
|
||||
root soft nofile=2147483584
|
||||
root soft stack=65536
|
||||
root hard nproc=65536
|
||||
root hard nofile=2147483584
|
||||
root hard stack=65536
|
||||
|
||||
# 预安装软件列表
|
||||
[app_list]
|
||||
app1=screen
|
||||
app2=tmux
|
||||
app3=gdb
|
||||
app4=fio
|
||||
app5=iperf,iperf3
|
||||
app6=sysstat
|
||||
app7=net-tools
|
||||
app8=jansson
|
||||
app9=snappy
|
||||
app10=ntp,chrony
|
||||
app11=tree
|
||||
app12=wget
|
||||
```
|
||||
## 安装前检查范围
|
||||
|
||||
| **检查项目** | **详细说明** |
|
||||
|:--|:----------|
|
||||
| **CPU 配置** | CPU 型号、核数 |
|
||||
| **内存配置** | 物理内存和虚拟内存大小 |
|
||||
| **磁盘配置** | 磁盘空间、磁盘类型、磁盘挂载信息、fsblk 信息和当前磁盘使用情况 |
|
||||
| **网络配置** | SSH 服务状态、22 端口是否可用和网络贷款 |
|
||||
| **系统配置** | 系统名称、当前时区配置、防火墙和 SElinux 服务状态 |
|
||||
| **coredump 配置** | coredump 路径是否配置 |
|
||||
| **域名解析配置** | /etd/hosts 文件是否包含安装 TDengine 集群所有节点的域名解析信息 |
|
||||
| **预安装软件** | 指定的原装软件是否已安装,若安装记录其版本 |
|
||||
| **SWAP 配置** | SWAP 状态和 SWAP 的当前配置 |
|
||||
| **KYSEC 配置** | KYSEC 服务是否关闭,该项检查仅针对麒麟系统 |
|
||||
| **系统参数配置** | 检查系统参数值是否与配置文件中指定系统参数的配置一致 |
|
||||
| **时间同步配置** | 时间同步工具是否安装并计算各节点间的时间偏差,精确到秒 |
|
||||
|
||||
## 结果文件
|
||||
安装前检查工具运行后会在工具运行当前目录下生成 precheck_report.md 和 precheck_advice.md 两个文件,其中 precheck_report.md 包含了检查结果,precheck_advice.md 包含了基于检查结果的一些环境配置建议。
|
||||
|
||||
## 应用示例
|
||||
|
||||
在工具所在节点以 local 模式执行安装前检查
|
||||
```
|
||||
./taosprecheck
|
||||
```
|
||||
以 SSH 模式在所有节点执行安装前检查
|
||||
```
|
||||
./taosprecheck -m ssh
|
||||
```
|
||||
指定配置文件并以 SSH 模式在所有节点执行安装前检查
|
||||
```
|
||||
./taosprecheck -m ssh -f /path_to_file/precheck.cfg
|
||||
```
|
||||
以 SSH 模式在所有节点执行安装前检查,包括检查磁盘写入性能
|
||||
```
|
||||
./taosprecheck -m ssh -c true
|
||||
```
|
|
@ -0,0 +1,118 @@
|
|||
---
|
||||
sidebar_label: 安装前预配置工具
|
||||
title: 安装前预配置工具
|
||||
toc_max_heading_level: 4
|
||||
---
|
||||
|
||||
## 背景
|
||||
|
||||
TDengine 的安装部署对环境系统有一定的依赖和要求,安装部署前需要进行环境预配置操作,本文档旨在说明安装前预配置工具在安装 TDengine 前对环境的预配置内容和工具的使用方法。
|
||||
|
||||
## 预配置工具使用方法
|
||||
|
||||
工具支持通过 help 参数查看支持的语法
|
||||
|
||||
```help
|
||||
Usage: taospreset [OPTIONS]
|
||||
|
||||
Pre-set for Database installation
|
||||
|
||||
Options:
|
||||
-m, --model [local|ssh] connection model, default: local
|
||||
-f, --config TEXT Full path of test config file [required]
|
||||
-b, --backend BOOLEAN Run process in backend. default: False
|
||||
-d, --disable-kysec BOOLEAN Disable kysec, default: False
|
||||
-v, --version Show version
|
||||
--help Show this message and exit.
|
||||
```
|
||||
|
||||
### 参数详细说明
|
||||
|
||||
- `model`:预配置工具运行模式,分为 local 和 ssh。安装环境的多节点间支持 SSH 通信,可选择 ssh 模式,在任意节点上运行预配置工具,会依次对所有节点环境完成预配置操作。反之,节点间不支持 SSH 通信时,可选择 local 模式,仅对工具运行所在机器完成预配置操作,默认为 local 模式。
|
||||
- `config`:预配置工具加载的配置文件,其具体配置方式详见 **配置文件使用说明** 章节。不配置 config 参数时配置文件默认路径为工具运行当前目录。
|
||||
- `backend`:后台运行预配置工具,选择 True 后预配置工具在自动在后台运行,默认为 False。
|
||||
- `disable-kysec`:是否关闭 Kylin Security 服务,KySec 是麒麟系统的安全模块框架,类似于 SELinux、AppArmor、Trusted Computing 的集合体,主要用于增强系统安全性。默认为 False
|
||||
- `version`:打印预配置工具版本信息。
|
||||
|
||||
### 配置文件使用说明
|
||||
|
||||
```config
|
||||
# 安装部署 TDengine 的环境信息,支持免密登录和 SSH 登录两种方式,当环境配置了免密登录后可不用配置 password 信息
|
||||
[test_env]
|
||||
# 节点间通过 SSH 协议访问
|
||||
firstep=192.168.0.1||fqdn=tdengine1||username=root||password=123456||port=22
|
||||
secondep=192.168.0.2||fqdn=tdengine2||username=root||password=123456||port=22
|
||||
dnode3=192.168.0.3||fqdn=tdengine3||username=root||username=123456||port=22
|
||||
|
||||
# 节点间配置免密登录
|
||||
# firstep=192.168.0.1||fqdn=tdengine1||username=root||port=22
|
||||
# secondep=192.168.0.2||fqdn=tdengine2||username=root||port=22
|
||||
# dnode3=192.168.0.3||fqdn=tdengine3||username=root||port=22
|
||||
|
||||
# 系统时区,工具会按照下面配置修改系统时区
|
||||
[timezone]
|
||||
tz=Asia/Shanghai
|
||||
|
||||
# 系统服务状态,工具会按照下面配置关闭对应的系统服务
|
||||
[services]
|
||||
firewall=inactive
|
||||
selinux=inactive
|
||||
|
||||
# coredump 配置,工具会按照下面配置 coredump 的生成路径
|
||||
[coredump]
|
||||
kernel.core_pattern=/data/taos/core/core-%%e-%%p
|
||||
|
||||
# /etc/sysctl.conf 中系统参数,工具会按照下面配置修改系统参数值
|
||||
[sys_vars:/etc/sysctl.conf]
|
||||
fs.nr_open=2147483584
|
||||
fs.file-max=2147483584
|
||||
net.ipv4.ip_local_port_range=10000 65534
|
||||
|
||||
# /etc/security/limits.conf 中系统参数,工具会按照下面配置修改系统参数值
|
||||
[sys_vars:/etc/security/limits.conf]
|
||||
* soft nproc=65536
|
||||
* soft nofile=2147483584
|
||||
* soft stack=65536
|
||||
* hard nproc=65536
|
||||
* hard nofile=2147483584
|
||||
* hard stack=65536
|
||||
root soft nproc=65536
|
||||
root soft nofile=2147483584
|
||||
root soft stack=65536
|
||||
root hard nproc=65536
|
||||
root hard nofile=2147483584
|
||||
root hard stack=65536
|
||||
```
|
||||
## 环境预配置范围
|
||||
|
||||
| **预配置项目** | **详细说明** |
|
||||
|:--|:----------|
|
||||
| **配置系统时区** | 配置系统时区为用户预设定时区 |
|
||||
| **关闭防火墙** | 关闭系统的防火墙服务 |
|
||||
| **关闭 SElinux 服务** | 关闭系统 SElinux 服务 |
|
||||
| **配置系统参数** | 配置用户预设定的系统参数 |
|
||||
| **配置 coredump** | 配置 coredump 生成目录并开启服务 |
|
||||
| **修改机器 Hostname** | 当机器 Hostanme 为默认的 localhost 时更新为配置文件中预设定的 FQDN |
|
||||
| **配置域名解析** | 将配置文件中安装节点的 FQDN 和 IP 配置到 /etd/hosts 文件 |
|
||||
|
||||
## 结果文件
|
||||
安装前预配置工具运行后会在工具运行当前目录下生成 preset_report.md 文件,其中包含了预配置工具修改的具体项目。
|
||||
|
||||
## 应用示例
|
||||
|
||||
在工具所在节点以 local 模式执行安装前预配置
|
||||
```
|
||||
./taospreset
|
||||
```
|
||||
以 SSH 模式在所有节点执行安装前预配置
|
||||
```
|
||||
./taospreset -m ssh
|
||||
```
|
||||
指定配置文件并以 SSH 模式在所有节点执行安装前预配置
|
||||
```
|
||||
./taospreset -m ssh -f /path_to_file/preset.cfg
|
||||
```
|
||||
以 SSH 模式在所有节点执行安装前预配置并关闭 Kylin Security 服务
|
||||
```
|
||||
./taospreset -m ssh -d true
|
||||
```
|
|
@ -0,0 +1,193 @@
|
|||
---
|
||||
sidebar_label: 安装工具
|
||||
title: 安装工具
|
||||
toc_max_heading_level: 4
|
||||
---
|
||||
|
||||
## 背景
|
||||
|
||||
TDengine 的安装包自带安装脚本,但无法基于集群进行自动化安装部署,本文档旨在说明如何使用安装工具进行 TDengine 的集群式安装部署。
|
||||
|
||||
## 安装工具支持功能
|
||||
| **安装方式** | **详细说明** |
|
||||
|:--|:----------|
|
||||
| **单节点安装部署** | 单节点环境安装部署 TDengine |
|
||||
| **集群安装部署** | 集群环境安装部署 TDengine |
|
||||
| **指定机器安装部署** | 指定集群中特定节点安装部署 TDengine |
|
||||
| **普通升级** | 单节点或集群关闭服务后升级 TDengine,**仅推荐测试换使用** |
|
||||
| **滚动升级** | 单节点或集群不停服务升级 TDengine,**仅推荐测试换使用** |
|
||||
|
||||
## 安装工具使用方法
|
||||
|
||||
工具支持通过 help 参数查看支持的语法
|
||||
|
||||
```help
|
||||
Usage: taosinstall [OPTIONS]
|
||||
|
||||
Install Database
|
||||
|
||||
Options:
|
||||
-m, --model [local|ssh] connection model, default: local
|
||||
-f, --config TEXT Full path of test config file [required]
|
||||
-b, --backend BOOLEAN Run process in backend. default: False
|
||||
-w, --workers INTEGER concurrency, default is 50
|
||||
-l, --list TEXT list of test hostnames, Separate with commas. None
|
||||
by default
|
||||
-u, --upgrade Upgrade Database
|
||||
-ru, --rolling-upgrade Rolling upgrade Database
|
||||
-v, --version Show version
|
||||
--help Show this message and exit.
|
||||
```
|
||||
|
||||
### 参数详细说明
|
||||
|
||||
- `model`:安装工具运行模式,分为 local 和 ssh。安装环境的多节点间支持 SSH 通信,可选择 ssh 模式,在任意节点上运行安装工具,会依次对所有节点环境完成安装操作。反之,节点间不支持 SSH 通信时,可选择 local 模式,仅对工具运行所在机器完成安装操作,默认为 local 模式。
|
||||
- `config`:安装工具加载的配置文件,其具体配置方式详见 **配置文件使用说明** 章节。不配置 config 参数时配置文件默认路径为工具运行当前目录。
|
||||
- `backend`:后台运行安装工具,选择 True 后安装工具在自动在后台运行,默认为 False。
|
||||
- `workers`:集群安装部署时的并发数量,会影响同时向多节点服务文件的并发数,需根据机器资源情况调整,默认是 50。
|
||||
- `list`:指定部署 TDengine 的机器,前提是配置文件中指定的 firstep 安装完成并服务运行部正常,该参数是预留给安装中断后继续安装剩余节点的场景使用,默认值为 None。
|
||||
- `upgrade`:普通升级,目前仅推荐测试环境使用。
|
||||
- `rolling-upgrade`:滚动升级,目前仅推荐测试环境使用。
|
||||
- `version`:打印安装工具版本信息。
|
||||
|
||||
### 配置文件使用说明
|
||||
|
||||
```config
|
||||
########################################################
|
||||
# #
|
||||
# Configuration #
|
||||
# #
|
||||
########################################################
|
||||
|
||||
# 安装部署 TDengine 的环境信息,支持免密登录和 SSH 登录两种方式,当环境配置了免密登录后可不用配置 password 信息
|
||||
[test_env]
|
||||
# 节点间通过 SSH 协议访问
|
||||
firstep=192.168.0.1||fqdn=tdengine1||username=root||password=123456||port=22
|
||||
secondep=192.168.0.2||fqdn=tdengine2||username=root||password=123456||port=22
|
||||
dnode3=192.168.0.3||fqdn=tdengine3||username=root||username=123456||port=22
|
||||
|
||||
# 节点间配置免密登录
|
||||
# firstep=192.168.0.1||fqdn=tdengine1||username=root||port=22
|
||||
# secondep=192.168.0.2||fqdn=tdengine2||username=root||port=22
|
||||
# dnode3=192.168.0.3||fqdn=tdengine3||username=root||port=22
|
||||
|
||||
# TDengine 安装包在本地所在全路径
|
||||
[local_pack]
|
||||
3.3.4.10=/path_to_file/TDengine-enterprise-3.3.4.10-Linux-x64.tar.gz
|
||||
|
||||
# 复制 TDengine 安装包到远程机器的目录
|
||||
[remote_pack]
|
||||
dir=/tmp
|
||||
|
||||
# oem 版本的版本名称,默认不使用
|
||||
# [oem]
|
||||
# version=prodb
|
||||
|
||||
# TDegine 的 Restful 连接信息
|
||||
[database]
|
||||
username=root
|
||||
password=taosdata
|
||||
port=6030
|
||||
rest_port=6041
|
||||
|
||||
# taosd 预配置文件, 该文件中配置会覆盖到所有 dnode 上对应配置文件
|
||||
[taos_cfg]
|
||||
cfg_file=taos.cfg
|
||||
|
||||
# taoskeeper的预配置文件, 该文件中配置会覆盖到所有 dnode 上对应配置文件
|
||||
[taoskeeper_cfg]
|
||||
cfg_file=taoskeeper.toml
|
||||
|
||||
# taosadapter 的预配置文件, 该文件中配置会覆盖到所有 dnode 上对应配置文件
|
||||
[taosadapter_cfg]
|
||||
cfg_file=taosadapter.toml
|
||||
|
||||
# taosx 的预配置文件, 该文件中配置会覆盖到所有 dnode 上对应配置文件
|
||||
[taosx_cfg]
|
||||
cfg_file=taosx.toml
|
||||
|
||||
# explorer 的预配置文件, 该文件中配置会覆盖到所有 dnode 上对应配置文件
|
||||
[taosexplorer_cfg]
|
||||
cfg_file=explorer.toml
|
||||
|
||||
# 监控用户 monitor 的配置信息
|
||||
[monitor_user]
|
||||
username=monitor
|
||||
password=Taosmonitor_125#
|
||||
```
|
||||
## 安装流程
|
||||
|
||||
| **No** | **安装步骤** | **详细说明** |
|
||||
|:-------|:------------|:-----------|
|
||||
| 1 | **复制安装包** | 复制安装包到集群个节点(local 安装模式跳过该步骤) |
|
||||
| 2 | **安装 TDengine** | 安装 TDengine |
|
||||
| 3 | **更新 taos 配置** | 基于预配置的 taosd 参数更新 taos.cfg,除了预配置的静态参数,还动态更新 firstEp、secondEp、fqdn、minReservedMemorySize |
|
||||
| 4 | **启动 taosd 服务** | 通过 sytstemctl 启动 taosd 服务 |
|
||||
| 5 | **更新 taosadapter 配置** | 基于预配置的 taosadapter 参数更新 taosadapter.toml |
|
||||
| 6 | **启动 taosadapter 服务** | 通过 sytstemctl 启动 taosadapter 服务 |
|
||||
| 7 | **创建集群所有 dnode** | 数据库初始化 dnode |
|
||||
| 8 | **创建 mnode** | 在 firstEp、secondEp 和 node3 上创建 monde(local 安装模式跳过该步骤) |
|
||||
| 9 | **更新 taosadapter 的 instanceId** | 更新 taosadapter 的 instanceId 并重启 taosadapter 服务 |
|
||||
| 10| **更新 taoskeeper 配置** | 基于预配置的 taoskeeper 参数更新 taoskeeper.toml 并更新 instanceId |
|
||||
| 11| **启动 taoskeeper 服务** | 通过 sytstemctl 启动 taoskeeper 服务 |
|
||||
| 12| **更新 taosx 配置** | 基于预配置的 taosx 参数更新 taosx.toml 并更新 instanceId |
|
||||
| 13| **启动 taosx 服务** | 通过 sytstemctl 启动 taosx 服务 |
|
||||
| 14| **更新 taos-explorer 配置** | 基于预配置的 taos-explorer 参数更新 explorer.toml 并更新 instanceId |
|
||||
| 15| **启动 taos-explorer 服务** | 通过 sytstemctl 启动 taos-explorer 服务 |
|
||||
| 16| **创建监控用户** | 数据库创建 monitor 用户 |
|
||||
| 17| **更新 taoskeeper 配置** | 更新 taoskeeper 配置文件中连接数据库的用户为 monitor |
|
||||
| 18| **启动 taoskeeper 服务** | 通过 sytstemctl 启动 taoskeeper 服务 |
|
||||
|
||||
## 升级流程
|
||||
### 停服升级
|
||||
停服升级会先停止所有节点的所有数据库服务,然后按照 firstEp、secondEp、dnode3...的顺序依次进行升级和重启服务操作
|
||||
| **No** | **安装步骤** | **详细说明** |
|
||||
|:-------|:------------|:-----------|
|
||||
| 1 | **复制安装包** | 复制安装包到集群个节点(local 安装模式跳过该步骤) |
|
||||
| 2 | **停止服务** | 停止 taosd、taosadapter、taoskeeper、taosx 和 taos-explorer 服务 |
|
||||
| 3 | **更新版本** | 更新 TDengine 到指定版本 |
|
||||
| 4 | **启动 taosd 服务** | 通过 sytstemctl 启动 taosd 服务 |
|
||||
| 5 | **启动 taosadapter 服务** | 通过 sytstemctl 启动 taosadapter 服务 |
|
||||
| 6 | **启动 taoskeeper 服务** | 通过 sytstemctl 启动 taoskeeper 服务 |
|
||||
| 7 | **启动 taosx 服务** | 通过 sytstemctl 启动 taosx 服务 |
|
||||
| 8 | **启动 taos-explorer 服务** | 通过 sytstemctl 启动 taos-explorer 服务 |
|
||||
|
||||
### 滚动升级
|
||||
按照非 monde 所在节点、mnode 为 follower 节点和 monde 为 leader 节点的顺序依次进行升级和重启服务操作
|
||||
| **No** | **安装步骤** | **详细说明** |
|
||||
|:-------|:------------|:-----------|
|
||||
| 1 | **复制安装包** | 复制安装包到集群个节点(local 安装模式跳过该步骤) |
|
||||
| 2 | **停止服务** | 停止 taosd、taosadapter、taoskeeper、taosx 和 taos-explorer 服务 |
|
||||
| 3 | **更新版本** | 更新 TDengine 到指定版本 |
|
||||
| 4 | **启动 taosd 服务** | 通过 sytstemctl 启动 taosd 服务 |
|
||||
| 5 | **启动 taosadapter 服务** | 通过 sytstemctl 启动 taosadapter 服务 |
|
||||
| 6 | **启动 taoskeeper 服务** | 通过 sytstemctl 启动 taoskeeper 服务 |
|
||||
| 7 | **启动 taosx 服务** | 通过 sytstemctl 启动 taosx 服务 |
|
||||
| 8 | **启动 taos-explorer 服务** | 通过 sytstemctl 启动 taos-explorer 服务 |
|
||||
|
||||
## 应用示例
|
||||
|
||||
在工具所在节点安装数据库
|
||||
```
|
||||
./taosinstall -m local
|
||||
```
|
||||
在集群所有节点安装数据库
|
||||
```
|
||||
./taosinstall -m ssh
|
||||
```
|
||||
指定配置文件并在集群所有节点安装数据库
|
||||
```
|
||||
./taosinstall -m ssh -f /path_to_file/install.cfg
|
||||
```
|
||||
在集群指定节点安装数据库
|
||||
```
|
||||
./taosinstall -m ssh -l server1,server2...
|
||||
```
|
||||
停服升级数据库
|
||||
```
|
||||
./taosinstall -m ssh -u
|
||||
```
|
||||
滚动升级数据库
|
||||
```
|
||||
./taosinstall -m ssh -ru
|
||||
```
|
|
@ -0,0 +1,216 @@
|
|||
---
|
||||
sidebar_label: 巡检工具
|
||||
title: 巡检工具
|
||||
toc_max_heading_level: 4
|
||||
---
|
||||
|
||||
## 背景
|
||||
|
||||
TDengine 在运行一段时间后需要针对运行环境和 TDengine 本身的运行状态进行定期巡检,本文档旨在说明如何使用巡检工具对 TDengine 的运行环境进行自动化检查。
|
||||
|
||||
## 安装工具使用方法
|
||||
|
||||
工具支持通过 help 参数查看支持的语法
|
||||
|
||||
```help
|
||||
Usage: taosinspect [OPTIONS]
|
||||
|
||||
Check Database deployment environment
|
||||
|
||||
Options:
|
||||
-m, --model [local|ssh] connection model, default: local
|
||||
-f, --config TEXT Full path of test config file [required]
|
||||
-r, --result TEXT Full path of result directory [required]
|
||||
-b, --backend BOOLEAN Run process in backend. default: False
|
||||
-cn, --check-nginx BOOLEAN Whether check nginx's config, default: False
|
||||
-v, --version Show version
|
||||
--help Show this message and exit.
|
||||
```
|
||||
|
||||
### 参数详细说明
|
||||
|
||||
- `model`:安装工具运行模式,分为 local 和 ssh。安装环境的多节点间支持 SSH 通信,可选择 ssh 模式,在任意节点上运行安装工具,会依次对所有节点环境完成安装操作。反之,节点间不支持 SSH 通信时,可选择 local 模式,仅对工具运行所在机器完成安装操作,默认为 local 模式。
|
||||
- `config`:安装工具加载的配置文件,其具体配置方式详见 **配置文件使用说明** 章节。不配置 config 参数时配置文件默认值为/etc/taos/inspect.cfg。
|
||||
- `result`:巡检运行结束后结果文件和相关日志文件的存储目录,默认是用户在 taos.cfg 中配置的 logDir 对应目录。
|
||||
- `backend`:后台运行安装工具,选择 True 后安装工具在自动在后台运行,默认为 False。
|
||||
- `check-nginx`:是否检测负载均衡 nginx 的配置文件,默认值为 False。
|
||||
- `version`:打印安装工具版本信息。
|
||||
|
||||
### 配置文件使用说明
|
||||
|
||||
```config
|
||||
########################################################
|
||||
# #
|
||||
# Configuration #
|
||||
# #
|
||||
########################################################
|
||||
|
||||
# 安装部署TDengine的环境信息,支持免密登录和SSH登录两种方式,当环境配置了免密登录后不用配置password信息。除此外还支持从TDengine自动获取集群信息,该模式下不需配置集群几点的ip和FQDN,仅需要配置连接各节点的用户信息(免密时不用配置password信息)
|
||||
[test_env]
|
||||
# 通过TDengine获取集群信息
|
||||
username=root
|
||||
password=123456
|
||||
port=22
|
||||
|
||||
# 节点间通过SSH协议访问
|
||||
# firstep=192.168.0.1||fqdn=tdengine1||username=root||password=123456||port=22
|
||||
# secondep=192.168.0.2||fqdn=tdengine2||username=root||password=123456||port=22
|
||||
# dnode3=192.168.0.3||fqdn=tdengine3||username=root||username=123456||port=22
|
||||
|
||||
# 节点间配置免密登录
|
||||
# firstep=192.168.0.1||fqdn=tdengine1||username=root||port=22
|
||||
# secondep=192.168.0.2||fqdn=tdengine2||username=root||port=22
|
||||
# dnode3=192.168.0.3||fqdn=tdengine3||username=root||port=22
|
||||
|
||||
# TDegine的Restful连接信息
|
||||
[database]
|
||||
username=root
|
||||
password=taosdata
|
||||
port=6030
|
||||
rest_port=6041
|
||||
|
||||
# Nginx服务所在服务器的连接信息
|
||||
[nginx]
|
||||
ip=192.168.0.100
|
||||
username=root
|
||||
password=123456
|
||||
port=22
|
||||
|
||||
# oem版本的版本名称,默认不使用
|
||||
# [oem]
|
||||
# version=prodb
|
||||
|
||||
# /etc/sysctl.conf中系统参数,工具会按照下面配置修改系统参数值
|
||||
[sys_vars:/etc/sysctl.conf]
|
||||
fs.nr_open=2147483584
|
||||
fs.file-max=2147483584
|
||||
net.ipv4.ip_local_port_range=10000 65534
|
||||
|
||||
# /etc/security/limits.conf中系统参数,工具会按照下面配置修改系统参数值
|
||||
[sys_vars:/etc/security/limits.conf]
|
||||
* soft nproc=65536
|
||||
* soft nofile=1048576
|
||||
* soft stack=65536
|
||||
* hard nproc=65536
|
||||
* hard nofile=1048576
|
||||
* hard stack=65536
|
||||
root soft nproc=65536
|
||||
root soft nofile=1048576
|
||||
root soft stack=65536
|
||||
root hard nproc=65536
|
||||
root hard nofile=1048576
|
||||
root hard stack=65536
|
||||
|
||||
# 预安装软件列表
|
||||
[app_list]
|
||||
app1=screen
|
||||
app2=tmux
|
||||
app3=gdb
|
||||
app4=fio
|
||||
app5=iperf,iperf3
|
||||
app6=sysstat
|
||||
app7=net-tools
|
||||
app8=jansson
|
||||
app9=snappy
|
||||
app10=ntp,chrony
|
||||
app11=tree
|
||||
app12=wget
|
||||
|
||||
# 巡检覆盖的TDengine服务范围
|
||||
[td_services]
|
||||
ts1=taosd
|
||||
ts2=taosadapter
|
||||
ts3=taoskeeper
|
||||
ts4=taosx
|
||||
ts5=taos-explorer
|
||||
|
||||
# 可忽略的TDengine错误日志
|
||||
[skip_error_strs]
|
||||
str1=failed to get monitor info
|
||||
str2=Table does not exist
|
||||
str3=failed to send
|
||||
str4=Fail to get table info
|
||||
```
|
||||
## 巡检范围
|
||||
### 磁盘巡检范围
|
||||
| **No** | **巡检项目** | **详细说明** | **告警规则** |
|
||||
|:-------|:------------|:-----------|:-----------|
|
||||
| 1 | **磁盘基本信息** | 磁盘类型和磁盘空间 | 无 | 磁盘已用空间低于 15% |
|
||||
| 2 | **磁盘挂载信息** | 通过 lsblk 查询的磁盘挂载信息 | 无 |
|
||||
| 3 | **数据库数据目录使用情况** | 数据目录的挂载路径,文件系统,存储类型,已用空间,可用空间和空间使用率 | 磁盘已用空间低于 15% |
|
||||
| 4 | **数据库数据目录 Inode 情况** | 数据目录对应的 idnode 已用空间,可用空间和空间使用率 | 无 |
|
||||
|
||||
### 系统巡检范围
|
||||
| **No** | **巡检项目** | **详细说明** | **告警规则** |
|
||||
|:-------|:------------|:-----------|:-----------|
|
||||
| 1 | **系统基本信息** | 系统名称、系统启动时间、防火墙和 SELinux 服务状态 | 防火墙或 SElinux 服务未关闭 |
|
||||
| 2 | **域名解析配置** | FQDN 和 IP 信息是否配置到/etc/hosts 文件 | 缺少任一 FQDN 的域名解析 |
|
||||
| 3 | **预安装软件** | 指定的原装软件是否已安装,若安装记录其版本 | 无 |
|
||||
| 4 | **系统参数配置** | 检查系统参数值是否与配置文件中指定系统参数的配置一致 | 无 |
|
||||
| 5 | **系统内存错误** | 收集系统内核错误日志信息 | 存在内核错误日志 |
|
||||
| 6 | **SWAPNESS 配置** | SWAPNESS 配置状态及其配置值大小 | SWAPNESS 配置值大于 10 |
|
||||
| 7 | **Coredump 配置** | coredump 路径是否配置 | 1. coredump 未配置;2. coredump 挂载目录为系统根目录;3. coredump 文件个数大于 0 |
|
||||
|
||||
### 数据库巡检范围
|
||||
| **No** | **巡检项目** | **详细说明** | **告警规则** |
|
||||
|:-------|:------------|:-----------|:-----------|
|
||||
| 1 | **数据库版本** | taosd、taos、taosKeeper、taosAdapter、taosX 和 taos-explorer 的版本信息 | 服务端和客户端的版本不一致 |
|
||||
| 2 | **taosd 进行打开文件数** | taosd 进行打开文件数大小 | 文件数量跟预设值不一致 |
|
||||
| 3 | **数据库服务状态** | 服务当前运行状态 | 任一服务运行状态异常 |
|
||||
| 4 | **数据库服务详情** | 服务自启动配置、启动时间、持续运行时间、内存占用空间和 CPU 使用率 | CPU 使用率超过 80% 持续时间超过 30 分钟 |
|
||||
| 5 | **数据库参数配置** | 数据库所有参数信息 | 无 |
|
||||
| 6 | **数据库错误日志** | 统计 taosd、taos 和 taosAdapter 的错误日志数量 | 有任意错误日志 |
|
||||
| 7 | **数据库 dnode 信息** | 每个 Dnode 分配的 vnodes 数量,dnode 状态,dnode 启动时间和最近一次重启时间 | dnode 存活数量小于集群 dnode 的总和 |
|
||||
| 8 | **数据库 mnode 信息** | 每个 mnode 的角色,mnode 状态,mnode 启动时间和最近一次重启时间 | mnode 存活数量小于集群 dnode 的总和 |
|
||||
| 9 | **数据库 vnode 信息** | 每个 vnode 所在 dnodeId、vgroupId、db 名称、当前状态、启动时间和 restored 状态 | 任一 vnode 的 restored 状态部位 True |
|
||||
| 10 | **数据库用户信息** | 数据库用户的相关配置和权限 | 1. Root 用户的默认密码未修改;2. 未配置监控专用的数据库用户;3. 普通数据库用户未定义 |
|
||||
| 11 | **数据库权限信息** | 数据库 Instance 的权限信息 | 1. 测点使用数超过授权数的 80%;2. 数据库授权到期时间距现在少于 90 天 |
|
||||
| 12 | **数据库慢查询** | 最近 30 天慢查询数量 | 最近 30 天有慢查询记录 |
|
||||
| 13 | **taosx 数据目录** | taosx 数据目录 | taosX 数据目录是默认系统根目录 |
|
||||
|
||||
### 库表巡检范围
|
||||
| **No** | **巡检项目** | **详细说明** | **告警规则** |
|
||||
|:-------|:------------|:-----------|:-----------|
|
||||
| 1 | **库表占用空间** | 数据库本地占用磁盘空间 | 无 |
|
||||
| 2 | **库表概要统计** | 数据库数量、超级表数量、子表数量、普通表数量、流数量、topic 数量和订阅数量。数据库本地占用磁盘空间 | 无 |
|
||||
| 3 | **测点统计** | 每个数据库已用测点数 | 测点使用数超过授权数的 80% |
|
||||
| 4 | **vgroup 分布信息** | 每个数据库的 vgroup 数量,每个 dnode 的 vgroup 数量 | 无 |
|
||||
| 5 | **vgroup 详细信息** | 每个数据库对应 vgroup 的 Leader 和 Follower 分布情况以及 vgroups 详情 | 无 |
|
||||
| 6 | **vnode 详细信息** | 每个数据库对应 vnode 的角色、FQDN、数据目录、占用磁盘空间、role_time、start_time 和 restored 状态 | 1. 目录下 SMA 或 WAL 文件占用磁盘空间超过 DATA 文件大小;2. vnode 数量大于 CPU 核数 * 2 |
|
||||
| 7 | **数据库副本数** | 每个数据库的副本数量 | 集群副本数小于 3 |
|
||||
| 8 | **数据库 Schema 定义** | 每个数据库的 Schema 定义 | 无 |
|
||||
| 9 | **超级表 Schema 定义** | 每个超级表的 Schema 定义 | 无 |
|
||||
| 10 | **超级表详细信息** | 每个超级表以及对应子表数量 | 数据库中没有任何超级表 |
|
||||
| 11 | **流计算信息** | 流 Schema 定义、流计算详情和任务详情 | 无 |
|
||||
| 12 | **订阅主题信息** | 主题 schema 定义、主题详情 | 无 |
|
||||
| 13 | **订阅消费者信息** | 消费者详情 | 无 |
|
||||
| 14 | **订阅信息** | 订阅详情 | 无 |
|
||||
|
||||
|
||||
### Nginx 配置巡检(可选)
|
||||
| **No** | **巡检项目** | **详细说明** | **告警规则** |
|
||||
|:-------|:------------|:-----------|:-----------|
|
||||
| 1 | **Nginx 配置** | 各节点的 hostanme 和 ip 是否正确配置到 Nginx 配置文件 | 配置文件中 FQDN 配置信息缺失或错误 |
|
||||
|
||||
|
||||
## 结果文件
|
||||
巡检工具运行后会在工具运行用户在 taos.cfg 中配置的 logDir 目录下生成三类文件,包含了巡检报告 inspect_report.md,巡检结构化数据 inspect.json,数据库和超级表初始化文件 stabel_schemas.md、各节点 taos、taosd 和 taosKeeper 对应的错误日志文件和各服务对应的配置文件。最后会将出错误日志文件以外的其他所有文件压缩为 results.zip
|
||||
|
||||
## 应用示例
|
||||
|
||||
在工具所在节点执行巡检任务
|
||||
```
|
||||
./taosinspect -m local
|
||||
```
|
||||
在集群所有节点执行巡检任务
|
||||
```
|
||||
./taosinspect -m ssh
|
||||
```
|
||||
指定配置文件并在集群所有节点执行巡检任务
|
||||
```
|
||||
./taosinspect -m ssh -f /path_to_file/install.cfg
|
||||
```
|
||||
在集群所有节点执行巡检任务,包括检查 nginx 服务配置文件
|
||||
```
|
||||
./taosinspect -m ssh -f /path_to_file/install.cfg -cn true
|
||||
```
|
|
@ -0,0 +1,41 @@
|
|||
---
|
||||
sidebar_label: 巡检工具
|
||||
title: 巡检工具
|
||||
---
|
||||
|
||||
本文档旨在介绍 TDengine 安装部署前后配套的巡检工具。
|
||||
|
||||
相关工具的功能简介:
|
||||
|
||||
| **工具名称** | **功能简介** |
|
||||
|:--|:----------|
|
||||
| **安装前检查** | 部署前对 TDengine 安装部署的依赖要素进行安装前检查 |
|
||||
| **安装前预配置** | 部署前对 TDengine 安装部署的依赖要素进行安装前预配置 |
|
||||
| **安装部署** | 指定环境安装部署 TDengine |
|
||||
| **例行巡检** | 基于 TDengine 环境,进行例行巡检和告警 |
|
||||
|
||||
## 支持的平台
|
||||
- Kylin V10
|
||||
- Ubuntu 20.04.2
|
||||
- CentOS 7.9
|
||||
- LinxOS 6.0.99
|
||||
- openEuler 23.09
|
||||
|
||||
## 支持的 TDengine 版本
|
||||
- 3.1.1.x
|
||||
- 3.3.3.x
|
||||
- 3.3.4.x
|
||||
|
||||
## 运行前提条件
|
||||
- 运行工具需要 root 权限。如果要由普通用户运行该工具,则需要 sudo 权限。
|
||||
- 运行工具环境要求安装 glibc 2.17 及以上版本。
|
||||
- 配置的 FQDN 和 IP 地址必须提前配置到 /etc/hosts 文件。
|
||||
- 在脚本执行期间,必须保证能通过 RESTful 远程连接 TDengine 服务。
|
||||
- 集群节点之间的 SSH 服务必须启用。如果无法启动 SSH 服务,则只能通过 local 模式在每个节点上单独运行工具。
|
||||
|
||||
```mdx-code-block
|
||||
import DocCardList from '@theme/DocCardList';
|
||||
import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
|
||||
|
||||
<DocCardList items={useCurrentSidebarCategory().items}/>
|
||||
```
|
Loading…
Reference in New Issue