【三】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 processing[default] .

#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

相关推荐
IT成长日记2 小时前
【Hadoop入门】Hadoop生态之MapReduce简介
大数据·hadoop·mapreduce
Apache Flink3 小时前
Dinky 和 Flink CDC 在实时整库同步的探索之路
大数据·flink
成长之路5144 小时前
【实证分析】数智化转型对制造企业全要素生产率的影响及机制探究(1999-2023年)
大数据
黑眼圈的小熊猫5 小时前
Git开发
大数据·git·elasticsearch
涛思数据(TDengine)5 小时前
虚拟表、TDgpt、JDBC 异步写入…TDengine 3.3.6.0 版本 8 大升级亮点
大数据·数据库·tdengine
goTsHgo6 小时前
Flink的 RecordWriter 数据通道 详解
大数据·flink
Romantic Rose6 小时前
你所拨打的电话是空号?手机状态查询API
大数据·人工智能
随缘而动,随遇而安7 小时前
第四十六篇 人力资源管理数据仓库架构设计与高阶实践
大数据·数据库·数据仓库·sql·数据库架构
小宋10217 小时前
Linux安装Elasticsearch详细教程
大数据·elasticsearch·搜索引擎