【三】TDengine 3.3.2 生产级别集群搭建

TDengine 3.3.2 集群搭建

集群规划

一、主机名和端口规划

修改主机信息:修改hosts信息,TDEngine是通过FQDN进行访问, 规划好三个节点对应的hostname。

vi /etc/hosts

追加以下信息

192.168.90.131 node1

192.168.90.132 node2

192.168.90.133 node3

修改hostname信息

vi /etc/hostname

根据hosts规划,输入节点名称

node1

验证:查看主机名,如果与hostname配置相符则出现 node1

hostname -f

开放防火墙6030~6041端口号,确保三个节点间的端口可以相互访问

二、安装TDengine

下载压缩包:从++++使用安装包立即开始 | TDengine 文档 | 涛思数据++++ 获取安装包,选择操作系统以及对应架构,下载压缩包,

解压压缩包

tar -zxvf TDengine-server-3.3.2.0-Linux-x64.tar.gz

安装

cd TDengine-server-3.1.1.0/

./install.sh

安装过程会提示如下信息,如果是第一个节点/单机部署,直接回车创建一个集群;如果是后续节点,输入主节点的hostname:port

启动TDengine服务,并查看状态

systemctl start taosd

systemctl status taosd

进入taos命令行

taos

输入 quit 退出命令行

  1. 配置集群

编辑配置文件

vi /etc/taos/taos.cfg

修改以下内容// firstEp 是每个数据节点首次启动后连接的第一个数据节点

firstEp node4:6030

secondEp node2:6030

// 必须配置为本数据节点的 FQDN,如果本机只有一个 hostname,可注释掉本项

fqdn node1

// 配置本数据节点的端口号,缺省是 6030

serverPort 6030

其他的 可选配置

All data files are stored in this directory, if you are using Windows platform please change to Windows path

dataDir /data/taos

#numberofthreads per CPU core

numOfThreadsPerCore 2.0

#numberofthreads to commit cache data

numOfCommitThreads 40

#theproportionof total CPU cores available for query processing

#2.0:thequerythreads will be set to double of the CPU cores.

#1.0:allCPUcores are available for query processingdefault .

#0.5:onlyhalfof the CPU cores are available for query.

#0.0:onlyonecore available.

ratioOfQueryCores 2.0

#thelast_row/first/lastaggregator will not change the original columnname in the result fields

keepColumnName 1

#numberofmanagement nodes in the system

numOfMnodes 2

#enable/disableloadbalancing

balance 0

#numberofseconds allowed for ad node to be offline, for cluster only

offlineThreshold 86400

#maxnumberof v groups per db, 0 means configured automatically

maxVgroupsPerDb 30

#numberofcache blocks per vnode

blocks 60

#thenumberof acknowledgments required for successful data writing

quorum 2

#max length of an SQL

maxSQLLength 1048576

#system timezone

timezone Asia/Shanghai(CST, +0800)

#system locale

locale enUS.UTF-8

default system charset

charset UTF-8

max number of connections allowed in dnode

maxShellConns 50000

max number of connections allowed in client

maxConnections 50000

enable/disable system monitor

monitor 1

wallevel 1

重启各个节点的TDengine服务

systemctl stop taosd

systemctl start taosd

systemctl status taosd

查看集群中的节点:

show dnodes;

如果节点只有一个主节点,则需要进入命令行,将其他从节点加入集群

taos

create dnode "node2:6030";

create dnode "node3:6030";

show dnodes;

如果其他从节点的status为offline,可能是服务没有启动/服务启动失败/配置文件中fqdn配置错误。

常见问题

服务启动失败。遇到服务启动失败,如下图所示

输入/usr/bin/taosd 查看失败来源

观察到localEp与/var/bin/taos目录下的配置文件不一致,直接删除原有的配置文件,再次启 动服务。

rm -rf /var/lib/taos

服务便能正确启动了。问题在于每次启动集群后,会在/var/bin/taos下生成各个节点的配置 json文件,启动后比对配置,如果不一致,则会启动失败。

注:因为rmtaos不会删除相关的数据、日志、集群配置,所以每次重新搭建集群后需要手动 删除以下文件

rm -rf /var/log/taos

rm -rf /var/bin/taos

rm -rf /var/lib/taos

卸载

如果是tar方式安装的, 卸载 TDengine 命令如下:

$ rmtaos

相关推荐
QY_Research_40 分钟前
2026房地产NFT平台创业机遇与落地指南分析报告
大数据·人工智能·物联网·机器人·制造
AI你一生一世3 小时前
不止于时序存储:DolphinDB 如何成为 AI 时代的工业智能底座
java·人工智能·struts·时序数据库·工业智能·dolphindb·ai基础设施
全栈陈序员4 小时前
【Git】从入门到精通(五)—— git add:将文件加入暂存区
大数据·git·elasticsearch
KKKlucifer5 小时前
国内数据安全服务的产品智能化转型:大模型赋能下的技术能力重构分析
大数据·数据库·重构
故七月7 小时前
AI 答案里的竞品共现:怎么看出赛道格局
大数据·人工智能
全栈陈序员7 小时前
【Git】从入门到精通(七)—— git status:查看仓库状态
大数据·git·elasticsearch
fengye2071618 小时前
第三章 编译cpython
大数据·elasticsearch·搜索引擎
大大大大晴天8 小时前
每天认识一个组件:Apache Flink
大数据
涛思数据(TDengine)9 小时前
从工业本体到 AI 原生:TDengine 出席 2026 QCon 分享工业数据基础设施路径
大数据·数据库·人工智能·tdengine·工业
Gu_WenYun9 小时前
从主题定价到订单定价:机器人基金的产业链观察
大数据·人工智能·金融