一、下载安装包

  • 1、访问官网:前往 TDengine(https://docs.taosdata.com/releases/tdengine/#!) 官网下载页面,选择适合的版本(如 TDengine-server-<version>-Linux-x64.tar.gz)。

    • 主流台式机、笔记本电脑、服务器:选择-x64,

    • 移动设备(手机、平板)、嵌入式系统(树莓派、工业控制器)、低功耗服务器:选择 -ARM64

  • 2、上传至服务器:通过宝塔文件管理或 scp/wget 命令将安装包上传至服务器指定目录(如 /tmp)。

  • 3、选择 TDengine-server-3.3.5.2-Linux-x64.tar.gz 版本 xd、xt、semp 使用了该版本

二、解压安装包

cd /tmp
tar -zxvf TDengine-server--Linux-x64.tar.gz
cd TDengine-server-

三、执行安装脚本

  • 运行安装命令:
  1. sudo ./install.sh -e no # 比较顺利
  2. 若需无交互安装(如自动化部署),可添加 -e no 参数:
  3. sudo ./install.sh
  • 处理 FQDN 提示:
  1. 集群部署时,需输入已有节点的 FQDN 或提前配置 /etc/hosts 文件。
  2. 首次安装单节点时,直接回车跳过 FQDN 输入。

四、配置 hostname 和 hosts 文件

  • 修改 hostname(避免使用 localhost):
    • sudo hostnamectl set-hostname tdserver # 示例名称

  • 编辑 hosts 文件:
    • sudo vim /etc/hosts

    • 添加一行(替换为实际 IP 和 hostname):`<服务器IP> tdserver # 视情况而定,是否添加

五、启动服务

sudo systemctl start taosd  # 启动 TDengine 服务
  sudo systemctl enable taosd # 设置开机自启
  sudo systemctl status taosd # 检查服务状态(需显示 "active (running)")
  
  root@tdserver:~# taos
  Welcome to the TDengine Command Line Interface, Client Version:3.3.5.2
  Copyright (c) 2023 by TDengine, all rights reserved.
  
    *********************************  Tab Completion  *************************************
    *   The TDengine CLI supports tab completion for a variety of items,                   *
    *   including database names, table names, function names and keywords.                *
    *   The full list of shortcut keys is as follows:                                      *
    *    [ TAB ]        ......  complete the current word                                  *
    *                   ......  if used on a blank line, display all supported commands    *
    *    [ Ctrl + A ]   ......  move cursor to the st[A]rt of the line                     *
    *    [ Ctrl + E ]   ......  move cursor to the [E]nd of the line                       *
    *    [ Ctrl + W ]   ......  move cursor to the middle of the line                      *
    *    [ Ctrl + L ]   ......  clear the entire screen                                    *
    *    [ Ctrl + K ]   ......  clear the screen after the cursor                          *
    *    [ Ctrl + U ]   ......  clear the screen before the cursor                         *
    ****************************************************************************************
  
  Server is TDengine Community Edition, ver:3.3.5.2 and will never expire.

六、验证安装

  • 进入命令行工具:
    • taos

    • 若提示连接失败,检查防火墙是否放行端口(默认 6030-6042、6060 TCP/UDP)。

七、可选配置

  • 修改配置文件:
    • sudo vim /etc/taos/taos.cfg

    • 调整参数如 dataDir(数据目录)、logDir(日志目录)等。

  • 重启服务:
    • sudo systemctl restart taosd

  • 常见问题解决
    • 端口冲突:

      • 确保 6030-6042 端口未被占用,或通过 netstat -tulnp | grep taosd 检查。

    • 权限问题:

      • 使用 sudo 执行安装和服务管理命令。

    • 集群部署: