首页 > 其他分享 >docker-compose部署tdengine 3.3.0.0集群

docker-compose部署tdengine 3.3.0.0集群

时间:2024-08-14 18:27:36浏览次数:10  
标签:compose log tdengine 0.0 cluster toml debug taos

说明:官方文档提供docker swarm部署多台服务器集群方式,不适用于公司目前部署方式,故研究多台服务器docker部署集群
目前只是部署,还未生产使用,仅供参考

一、环境:
服务器3台,系统为Ubuntu 20.04.4 LTS
emscluster01 10.1.1.103
emscluster02 10.1.1.104
emscluster03 10.1.1.105

二、部署文档
2.1 节点1文档

version: "3"
services:
  td-cluster:
    image: tdengine/tdengine:3.3.0.0
    hostname: emscluster01
    container_name: emscluster01
    privileged: true
    environment:
      TAOS_FQDN: "emscluster01"
      TAOS_FIRST_EP: "emscluster01"
      emscluster01: "10.1.1.103"
      emscluster02: "10.1.1.104"
      emscluster03: "10.1.1.105"
    network_mode: host
    volumes:
      - ~/tdengine-cluster/data:/var/lib/taos
      - ~/tdengine-cluster/log:/var/log/taos
      - ~/tdengine-cluster/conf/taos.cfg:/etc/taos/taos.cfg
      - ~/tdengine-cluster/conf/explorer.toml:/etc/taos/explorer.toml
      - ~/tdengine-cluster/conf/taosadapter.toml:/etc/taos/taosadapter.toml
      - ~/tdengine-cluster/conf/taoskeeper.toml:/etc/taos/taoskeeper.toml

2.2 节点2文档

version: "3"
services:
  td-cluster:
    image: tdengine/tdengine:3.3.0.0
    hostname: emscluster02
    container_name: emscluster02
    privileged: true
    environment:
      emscluster01: "10.1.1.103"
      emscluster02: "10.1.1.104"
      emscluster03: "10.1.1.105"
    network_mode: host
    volumes:
      - ~/tdengine-cluster/data:/var/lib/taos
      - ~/tdengine-cluster/log:/var/log/taos
      - ~/tdengine-cluster/conf/taos.cfg:/etc/taos/taos.cfg
      - ~/tdengine-cluster/conf/explorer.toml:/etc/taos/explorer.toml
      - ~/tdengine-cluster/conf/taosadapter.toml:/etc/taos/taosadapter.toml
      - ~/tdengine-cluster/conf/taoskeeper.toml:/etc/taos/taoskeeper.toml

2.3 节点3文档

version: "3"
services:
  td-cluster:
    image: tdengine/tdengine:3.3.0.0
    hostname: emscluster03
    container_name: emscluster03
    privileged: true
    environment:
      emscluster01: "10.1.1.103"
      emscluster02: "10.1.1.104"
      emscluster03: "10.1.1.105"
    network_mode: host
    volumes:
      - ~/tdengine-cluster/data:/var/lib/taos
      - ~/tdengine-cluster/log:/var/log/taos
      - ~/tdengine-cluster/conf/taos.cfg:/etc/taos/taos.cfg
      - ~/tdengine-cluster/conf/explorer.toml:/etc/taos/explorer.toml
      - ~/tdengine-cluster/conf/taosadapter.toml:/etc/taos/taosadapter.toml
      - ~/tdengine-cluster/conf/taoskeeper.toml:/etc/taos/taoskeeper.toml

三、服务器配置如下
根据每台服务器实际域名或地址进行修改
explorer.toml

# This is a automacically generated configuration file for Explorer in [TOML](https://toml.io/) format.
#
# Here is a full list of available options.

# Explorer server port to listen on.
# Default is 6060.
#
port = 6060

# IPv4 listen address.
# Default is 0.0.0.0
addr = "0.0.0.0"

# IPv6 listen address.

# ipv6 = "::1"

# Explorer server log level.
# Default is "info"
#
log_level = "info"

# REST API endpoint to connect to the cluster.
#   Default is "http://buildkitsandbox:6041" - the default endpoint for REST API.
#
cluster = "http://emscluster01:6041"

# API endpoint for data replication/backup/data sources. No default option.
#   Set it to API URL like "http://buildkitsandbox:6050".
#
x_api ="http://emscluster01:6050"

# GRPC endpoint for "Agent"s.
#   Default is "http://buildkitsandbox:6055" - the default endpoint for taosX grpc API.
#   You should set it to public IP or FQDN name like:
#   "http://192.168.111.111:6055" or "http://node1.company.domain:6055" and
#   ensure to add the port to the exception list of the firewall if it enabled.
grpc = "http://emscluster01:6055"

# cloud open api.
# cloud_open_api = "https://pre.ali.cloud.taosdata.com/openapi"

# Enable ssl
# If the following two files exist, enable ssl protocol
#
[ssl]

# SSL certificate
#
# certificate = "/path/to/ca.file"

# SSL certificate key
#
# certificate_key = "/path/to/key.file"

taosadapter.toml

debug = true
taosConfigDir = ""
port = 6041
logLevel = "info"
httpCodeServerError = false
SMLAutoCreateDB = false

[cors]
allowAllOrigins = true

#[pool]
#maxConnect = 0
#maxIdle = 0
#idleTimeout = 0

[ssl]
enable = false
certFile = ""
keyFile = ""

[log]
#path = "/var/log/taos"
rotationCount = 30
rotationTime = "24h"
rotationSize = "1GB"
enableRecordHttpSql = false
sqlRotationCount = 2
sqlRotationTime = "24h"
sqlRotationSize = "1GB"

[monitor]
disable = true
collectDuration = "3s"
disableCollectClientIP = true
incgroup = false
pauseQueryMemoryThreshold = 70
pauseAllMemoryThreshold = 80
identity = ""
writeToTD = false
user = "root"
password = "taosdata"
writeInterval = "30s"

[uploadKeeper]
enable = false
url = "http://127.0.0.1:6043/adapter_report"
interval = "15s"
timeout = "5s"
retryTimes = 3
retryInterval = "5s"

[opentsdb]
enable = true

[influxdb]
enable = true

[statsd]
enable = false
port = 6044
db = "statsd"
user = "root"
password = "taosdata"
worker = 10
gatherInterval = "5s"
protocol = "udp4"
maxTCPConnections = 250
tcpKeepAlive = false
allowPendingMessages = 50000
deleteCounters = true
deleteGauges = true
deleteSets = true
deleteTimings = true

[collectd]
enable = false
port = 6045
db = "collectd"
user = "root"
password = "taosdata"
worker = 10


[opentsdb_telnet]
enable = false
maxTCPConnections = 250
tcpKeepAlive = false
dbs = ["opentsdb_telnet", "collectd", "icinga2", "tcollector"]
ports = [6046, 6047, 6048, 6049]
user = "root"
password = "taosdata"
batchSize = 1
flushInterval = "0s"

[node_exporter]
enable = false
db = "node_exporter"
user = "root"
password = "taosdata"
urls = ["http://emscluster01:9100"]
responseTimeout = "5s"
httpUsername = ""
httpPassword = ""
httpBearerTokenString = ""
caCertFile = ""
certFile = ""
keyFile = ""
insecureSkipVerify = true
gatherDuration = "5s"

[prometheus]
enable = true

[tmq]
releaseIntervalMultiplierForAutocommit = 2

taos.cfg

########################################################
#                                                      #
#                  Configuration                       #
#                                                      #
########################################################

######### 0. Client only configurations #############

# The interval for CLI to send heartbeat to mnode
# shellActivityTimer        3


############### 1. Cluster End point ############################

# The end point of the first dnode in the cluster to be connected to when this dnode or the CLI utility is started
# firstEp                   hostname:6030
firstEp                   emscluster01:6030

# The end point of the second dnode to be connected to if the firstEp is not available
# secondEp
secondEp emscluster02:6030


############### 2. Configuration Parameters of current dnode #####

# The FQDN of the host on which this dnode will be started. It can be IP address
fqdn                      emscluster01

# The port for external access after this dnode is started
# serverPort                6030
serverPort                6030

# The maximum number of connections a dnode can accept
# maxShellConns             5000

# The directory for writing log files, if you are using Windows platform please change to Windows path
# logDir                    /var/log/taos

# All data files are stored in this directory, if you are using Windows platform please change to Windows path
# dataDir                   /var/lib/taos

# temporary file's directory, if you are using Windows platform please change to Windows path
# tempDir                   /tmp/

# Switch for allowing to collect and report service usage information
# telemetryReporting        1

# Switch for allowing to collect and report crash information
# crashReporting            1

# The maximum number of vnodes supported by this dnode
# supportVnodes             0

# The interval of this dnode reporting status to mnode, [1..10] seconds
# statusInterval            1

# The minimum sliding window time, milli-second
# minSlidingTime            10

# The minimum time window, milli-second
# minIntervalTime           10

# The maximum allowed query buffer size in MB during query processing for each data node
# -1 no limit (default)
# 0  no query allowed, queries are disabled
# queryBufferSize           -1

# The compressed rpc message, option:
#  -1 (no compression)
#   0 (all message compressed),
# > 0 (rpc message body which larger than this value will be compressed)
# compressMsgSize           -1

# query retrieved column data compression option:
#  -1 (no compression)
#   0 (all retrieved column data compressed),
# > 0 (any retrieved column size greater than this value all data will be compressed.)
# compressColData           -1

# system time zone
# timezone                  UTC-8

# system time zone (for windows 10)
# timezone              Asia/Shanghai (CST, +0800)

# system locale
# locale                    en_US.UTF-8

# system charset
# charset                   UTF-8

# stop writing logs when the disk size of the log folder is less than this value
# minimalLogDirGB           1.0

# stop writing temporary files when the disk size of the tmp folder is less than this value
# minimalTmpDirGB           1.0

# if free disk space is less than this value, this dnode will fail to start
# minimalDataDirGB          2.0

# enable/disable system monitor
# monitor                   1

# enable/disable audit log
# audit                     1

# enable/disable audit create table
# auditCreateTable                     1

# The following parameter is used to limit the maximum number of lines in log files.
# max number of lines per log filters
# numOfLogLines             10000000

# write log in async way: 1 - async, 0 - sync
# asyncLog                  1

# time period of keeping log files, in days
# logKeepDays               0


############ 3. Debug Flag and levels #############################################

# The following parameters are used for debug purpose only by this dnode.
# debugFlag is a 8 bits mask: FILE-SCREEN-UNUSED-HeartBeat-DUMP-TRACE_WARN-ERROR
# Available debug levels are:
# 131: output warning and error
# 135: output debug, warning and error
# 143: output trace, debug, warning and error to log
# 199: output debug, warning and error to both screen and file
# 207: output trace, debug, warning and error to both screen and file

# debug flag for all log type, take effect when non-zero value
# debugFlag                 0

# debug flag for timer
# tmrDebugFlag              131

# debug flag for util
# uDebugFlag                131

# debug flag for rpc
# rpcDebugFlag              131

# debug flag for jni
# jniDebugFlag              131

# debug flag for query
# qDebugFlag                131

# debug flag for client driver
# cDebugFlag                131

# debug flag for dnode messages
# dDebugFlag                135

# debug flag for vnode
# vDebugFlag                131

# debug flag for meta management messages
# mDebugFlag                135

# debug flag for wal
# wDebugFlag                135

# debug flag for sync module
# sDebugFlag                135

# debug flag for tsdb
# tsdbDebugFlag             131

# debug flag for tq
# tqDebugFlag               131

# debug flag for fs
# fsDebugFlag               131

# debug flag for udf
# udfDebugFlag              131

# debug flag for sma
# smaDebugFlag              131

# debug flag for index
# idxDebugFlag              131

# debug flag for tdb
# tdbDebugFlag              131

# debug flag for meta
# metaDebugFlag             131

# generate core file when service crash
# enableCoreFile            1
monitor 1
monitorFQDN emscluster01
audit 1

taoskeeper.toml

# Start with debug middleware for gin
debug = false

# Listen port, default is 6043
port = 6043

# log level
loglevel = "info"

# go pool size
gopoolsize = 50000

# interval for metrics
RotationInterval = "15s"

[tdengine]
#host = "buildkitsandbox"
host = "emscluster01"
port = 6041
username = "root"
password = "taosdata"

[metrics]
# metrics prefix in metrics names.
prefix = "taos"

# database for storing metrics data
database = "log"

# export some tables that are not super table
tables = []

# database options for db storing metrics data
[metrics.databaseoptions]
cachemodel = "none"

[environment]
# Whether running in cgroup.
incgroup = false

[audit]
[audit.database]
name = "audit"
[audit.database.options]
cachemodel = "none"

[log]
#path = "/var/log/taos"
rotationCount = 5
rotationTime = "24h"
rotationSize = 100000000

四、实际验证

taos> show dnodes;
     id      |            endpoint            | vnodes | support_vnodes |    status    |       create_time       |       reboot_time       |              note             
===========================================================================================================================================================================
           1 | emscluster01:6030              |      8 |              8 | ready        | 2024-08-14 09:17:25.996 | 2024-08-14 09:17:25.950 |                               
           2 | emscluster02:6030              |      8 |              8 | ready        | 2024-08-14 09:21:16.497 | 2024-08-14 09:31:33.495 |                               
           3 | emscluster03:6030              |      8 |              8 | ready        | 2024-08-14 09:29:05.673 | 2024-08-14 09:43:35.499 |                               
Query OK, 3 row(s) in set (0.001558s)

标签:compose,log,tdengine,0.0,cluster,toml,debug,taos
From: https://blog.csdn.net/inventecsh/article/details/141196774

相关文章

  • Android 10.0 SystemUI下拉状态栏QSTileView去掉着色效果显示彩色图标功能实现
    1.前言在10.0的系统rom定制化开发中,在关于SystemUI的下拉状态栏中QSTileView的背景颜色设置过程中,在由于系统原生有着色效果,导致现在某些彩色背景显示不是很清楚效果不好,所以需要去掉QSTileView的默认着色背景显示原生的彩色背景,接下来就来实现相关功能如图: 2.SystemUI......
  • composer show ***没有显示最新版本
    如果执行 composershow 没有显示最新版本,可能有以下几个原因:缓存问题:Composer可能缓存了旧的版本信息。您可以尝试运行 composerclear-cache 命令来清除缓存,然后再次执行 composershow 。更换存储库:在Windows系统中,切换Composer的源非常简单。以下是一些常用的国内镜......
  • centos7配置yum源 安装 docker 安装Docker Compose 安装Python 3.7并汉化 (python可不
    安装一个软件确认无误就执行备份,在关键步骤之前一定做好备份以防止重来,造成时间的大量浪费注意有时因各自网络环境原因,wget显示拒绝连接,要么等五分钟再试要么就把网址粘贴到百度去下载相对应的安装包,通过ftp,xftp等拷贝到虚拟机中。若有问题欢迎评论留言,我会尝试解决。现......
  • docker-compose 部署https harbor
    httpsharbor提升安全性,部署更加合规一、配置Harbor证书1、生成自签名ca和ca证书,subj信息看需求修改这里的-subj参数设置了证书的主题信息,包括国家代码(C),州或省份(ST),城市(L),组织(O),和常用名(CN)。有效期设置为20年。#生成CA私钥opensslgenrsa-outca.key4......
  • Jenkins+gitlab+harbor+docker-compose自动化部署配置
    本文主要讲解Jenkins在Linux环境下实现自动化部署项目(提供一种思路)持续集成与持续部署(CI/CD)流程的实现,需要依赖一系列先进的工具和技术。这些工具不仅提高了开发效率,还确保了代码质量和发布的可靠性。以下是构建CI/CD流程所需的关键工具列表及其作用概述:Jenkins-作为自动化......
  • Ubuntu20.04搭建eclipse for C++环境
    【转载说明】适用于Ubuntu20.04上的C/C++开发人员的EclipseIDE。文章分为三部分。如何安装EclipseIDE先决条件如何下载面向C/C++开发人员的EclipseIDE如何提取EclipseIDEforC/C++Developers包EclipseIDE需要JavaJRE作为先决条件。因此,我们的第......
  • 简单的python web项目的docker-compose.yml 示例
    一个简单的pythonweb项目,包含redis,mysql,nginx,定时业务调度等其中web启动注册了自定义命令flaskcreate-db&&flaskinit-db&&uwsgi/web/uwsgi.iniversion:'3.5'services:db:image:mysqlcontainer_name:yeping_mysqlcommand:--default-......
  • ubuntu20.04 解决第一次(或U盘安装)时黑屏问题
    前言环境电脑:thinkbook142024i5-13500HRTX3050网卡:IntelAX211Wi-Fi6系统内核:5.15问题原因由于ubuntu系统和显卡驱动之间的冲突,导致电脑不支持Nvidia系列显卡,所以开机黑屏。解决方法方法一、显卡设置为集显模式进入电脑的bios,将显卡模式设置为集显模式。保存重......
  • 在Kali(Debian)系统上安装docker&docker-compose并给docker配置socks代理
    在Kali(Debian)系统上安装docker&docker-compose并给docker配置socks代理安装docker方法一:使用kali官方的安装方式(经测试,安装的docker版本为20.0)参考链接如下InstallingDockeronKaliLinux由于现在dockerhub的镜像站都挂了(可能?),为了方便的配置代理拉取镜像,推荐使用方......
  • ubuntu20.04中文界面设置
    1,进入ubuntu界面,首先要做的是更换下载源。打开Software&Updates,选择UbuntuSoftware菜单,在Downloadfrom处选择“阿里云”下载源(xxxx.aliyun.com)2,然后更新系统中可用软件包的信息,以便后续包含中文语言包的信息。3.打开设置,找到地区和语言(Region&Language),选择"Manageinsta......