【三】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

相关推荐
shuxianshrng26 分钟前
鹰眼降尘系统怎么样
大数据·服务器·人工智能·数码相机·物联网
优思学院30 分钟前
优思学院|如何从零开始自己学习六西格玛?
大数据·运维·服务器·学习·六西格玛黑带·cssbb
JermeryBesian1 小时前
Flink系列知识之:Checkpoint原理
大数据·flink
lwprain1 小时前
编写第一个hadoop3.3.6的mapreduce程序
大数据·mapreduce
妙龄少女郭德纲1 小时前
基于Spark框架实现XGBoost模型
大数据·分布式·spark
全栈弟弟1 小时前
高级大数据开发协会
大数据·数据仓库·hadoop·flink·spark
APItesterCris2 小时前
API 接入前的安全防线:注意事项全梳理
大数据·运维·服务器·开发语言·数据仓库·安全
SeaTunnel2 小时前
Apache SeaTunnel Zeta引擎源码解析(三) Server端接收任务的执行流程
大数据
AI智能说3 小时前
建立这一新框架以应对人才紧缺时期的敏捷内容运营
大数据·人工智能·内容运营
lzhlizihang3 小时前
Hadoop的一些高频面试题 --- hdfs、mapreduce以及yarn的面试题
大数据·hadoop·hdfs·mapreduce·面试题·yarn