taosdata/TDengine
GitHub: taosdata/TDengine
高性能云原生时序数据库,专为物联网和工业场景设计,内置 AI 分析能力。
Stars: 24748 | Forks: 4999
[](https://github.com/taosdata/TDengine/actions/workflows/tdengine-release-build.yml)
[](https://coveralls.io/github/taosdata/TDengine?branch=3.0)
[](https://github.com/feici02/TDengine/commits/main/)
[](https://github.com/taosdata/TDengine/releases) [](https://github.com/taosdata/TDengine/blob/main/LICENSE) [](https://bestpractices.coreinfrastructure.org/projects/4201)
[](https://twitter.com/tdenginedb) [](https://www.youtube.com/@tdengine) [](https://discord.com/invite/VZdSuUg4pS) [](https://www.linkedin.com/company/tdengine) [](https://stackoverflow.com/questions/tagged/tdengine) [](https://deepwiki.com/taosdata/TDengine) English | [简体中文](README-CN.md) | [TDengine Cloud](https://cloud.tdengine.com) | [了解更多关于 TSDB](https://tdengine.com/time-series-database/) # 目录 - [1. 介绍](#1-introduction) - [2. 文档](#2-documentation) - [3. 前置条件](#3-prerequisites) - [3.1 Linux 系统前置条件](#31-prerequisites-on-linux) - [3.1.1 Ubuntu 系统](#311-for-ubuntu) - [3.1.2 CentOS 系统](#312-for-centos) - [3.2 macOS 系统前置条件](#32-prerequisites-on-macos) - [3.3 Windows 系统前置条件](#33-prerequisites-on-windows) - [3.4 克隆仓库](#34-clone-the-repo) - [4. 构建](#4-building) - [4.1 在 Linux 上构建](#41-build-on-linux) - [4.2 在 macOS 上构建](#42-build-on-macos) - [4.3 在 Windows 上构建](#43-build-on-windows) - [5. 打包](#5-packaging) - [6. 安装](#6-installation) - [6.1 在 Linux 上安装](#61-install-on-linux) - [6.2 在 macOS 上安装](#62-install-on-macos) - [6.3 在 Windows 上安装](#63-install-on-windows) - [7. 运行](#7-running) - [7.1 在 Linux 上运行 TDengine](#71-run-tdengine-on-linux) - [7.2 在 macOS 上运行 TDengine](#72-run-tdengine-on-macos) - [7.3 在 Windows 上运行 TDengine](#73-run-tdengine-on-windows) - [8. 测试](#8-testing) - [9. 发布](#9-releasing) - [10. 工作流](#10-workflow) - [11. 覆盖率](#11-coverage) - [12. 贡献](#12-contributing) # 1. 介绍 TDengine 是一款开源、高性能、云原生且 AI 驱动的 [时序数据库](https://tdengine.com/tsdb/) (Time-Series Database),专为物联网 、联网汽车 和工业物联网 设计。它能够高效地对每天由数十亿个传感器和数据采集器生成的 TB 级甚至 PB 级数据进行实时摄入、处理和分析。TDengine 凭借以下优势与其他时序数据库区分开来: - **[高性能](https://tdengine.com/tdengine/high-performance-time-series-database/)**: TDengine 是唯一解决了高基数问题 的时序数据库,能够支持数十亿个数据采集点,同时在数据摄入、查询和数据压缩方面优于其他时序数据库。 - **[简化解决方案](https://tdengine.com/tdengine/simplified-time-series-data-solution/)**: 通过内置缓存、流处理、数据订阅和 AI Agent 功能,TDengine 为时序数据处理提供了简化的解决方案。它显著降低了系统设计复杂度和运营成本。 - **[云原生](https://tdengine.com/tdengine/cloud-native-time-series-database/)**: 通过原生分布式设计、分片和分区、存算分离、RAFT 一致性算法、支持 Kubernetes 部署以及全栈可观测性,TDengine 是一款云原生时序数据库,可部署在公有云、私有云或混合云上。 - **[AI 驱动](https://tdengine.com/tdengine/tdgpt/)**: 通过内置的 AI Agent TDgpt,TDengine 可以连接多种时序基础模型、大语言模型 (LLM)、机器学习算法和传统算法,提供时序数据预测、异常检测、数据填补 和分类功能。 - **[易用性](https://tdengine.com/tdengine/easy-time-series-data-platform/)**: 对于管理员,TDengine 显著减少了部署和维护的工作量。对于开发者,它提供了简单的接口、简化的解决方案以及与第三方工具的无缝集成。对于数据用户,它让数据访问变得更加容易。 - **[轻松数据分析](https://tdengine.com/tdengine/time-series-data-analytics-made-easy/)**: 通过超级表、存算分离、按时间间隔分区、预计算和 AI Agent,TDengine 使探索、格式化和访问数据变得高效且容易。 - **[开源](https://tdengine.com/tdengine/open-source-time-series-database/)**: TDengine 的核心模块,包括集群功能和 AI Agent,均在开源许可证下提供。它在 GitHub 上已获得 23.7k 星标。拥有活跃的开发者社区,全球运行实例超过 73 万个。 有关 TDengine 竞争优势的完整列表,请[点击这里查看](https://tdengine.com/tdengine/)。体验 TDengine 最简单的方式是通过 [TDengine Cloud](https://cloud.tdengine.com)。有关 TDengine 最新组件 TDgpt 的详细信息,请参阅 [TDgpt README](./tools/tdgpt/README.md)。 # 2. 文档 有关用户手册、系统设计和架构,请参阅 [TDengine Documentation](https://docs.tdengine.com) ([TDengine 文档](https://docs.taosdata.com)) 您可以选择通过 [容器](https://docs.tdengine.com/get-started/deploy-in-docker/)、[安装包](https://docs.tdengine.com/get-started/deploy-from-package/)、[Kubernetes](https://docs.tdengine.com/operations-and-maintenance/deploy-your-cluster/#kubernetes-deployment) 安装 TDengine,或者无需安装直接试用[全托管服务](https://cloud.tdengine.com/)。本快速指南面向希望自行贡献、构建、发布和测试 TDengine 的开发者。 如需贡献/构建/测试 TDengine 连接器,请查看以下仓库:[JDBC Connector](https://github.com/taosdata/taos-connector-jdbc), [Go Connector](https://github.com/taosdata/driver-go), [Python Connector](https://github.com/taosdata/taos-connector-python), [Node.js Connector](https://github.com/taosdata/taos-connector-node), [C# Connector](https://github.com/taosdata/taos-connector-dotnet), [Rust Connector](https://github.com/taosdata/taos-connector-rust)。 # 3. 前置条件 目前,TDengine 服务器支持在 Linux/macOS 系统上运行。任何应用程序也可以选择 taosAdapter 提供的 RESTful 接口来连接 taosd 服务。TDengine 支持 X64/ARM64 CPU,未来将支持 MIPS64、Alpha64、ARM32、RISC-V 等 CPU 架构。目前我们不支持在交叉编译环境下构建。 从 3.1.0.0 版本开始,TDengine 仅在 TSDB-Enterprise 版本中支持 Windows 系统。 如果您想编译 taosAdapter 或 taosKeeper,需要安装 Go 1.23 或更高版本。 ## 3.1 Linux 系统前置条件
## 3.2 macOS 系统前置条件
## 3.3 Windows 系统前置条件
不适用于 TDengine TSDB-OSS 版本。
## 3.4 克隆仓库
将仓库克隆到目标机器:
```
git clone https://github.com/taosdata/TDengine.git
cd TDengine
```
# 4. 构建
TDengine 提供了一些有用的工具,如 taosBenchmark(曾用名 taosdemo)和 taosdump。它们曾是 TDengine 的一部分。默认情况下,TDengine 编译不包含 taosTools。您可以使用 `cmake .. -DBUILD_TOOLS=true` 让它们随 TDengine 一起编译。
TDengine 构建需要 [GCC](https://gcc.gnu.org/) 9.3.1 或更高版本以及 [CMake](https://cmake.org/) 3.18.0 或更高版本。
## 4.1 在 Linux 上构建
## 4.2 在 macOS 上构建
## 4.3 在 Windows 上构建
不适用于 TDengine TSDB-OSS 版本。
# 5. 打包
由于某些组件依赖关系,TDengine TSDB-OSS 安装程序无法仅通过此仓库创建。我们仍在努力改进这一点。
# 6. 安装
## 6.1 在 Linux 上安装
## 6.2 在 macOS 上安装
## 6.3 在 Windows 上安装
不适用于 TDengine TSDB-OSS 版本。
# 7. 运行
## 7.1 在 Linux 上运行 TDengine
## 7.2 在 macOS 上运行 TDengine
## 7.3 在 Windows 上运行 TDengine
不适用于 TDengine TSDB-OSS 版本。
# 8. 测试
关于如何在 TDengine 上运行不同类型的测试,请参阅 [Testing TDengine](./tests/README.md)。
# 9. 发布
有关 TDengine 发布版本的完整列表,请参阅 [Releases](https://github.com/taosdata/TDengine/releases)。
# 10. 工作流
TDengine 构建检查工作流可以在 [Github Action](https://github.com/taosdata/TDengine/actions/workflows/taosd-ci-build.yml) 中找到。更多工作流即将推出。
# 11. 覆盖率
最新的 TDengine 测试覆盖率报告可以在 [coveralls.io](https://coveralls.io/github/taosdata/TDengine) 上找到
# 12. 贡献
请遵循[贡献指南](
[](https://github.com/taosdata/TDengine/releases) [](https://github.com/taosdata/TDengine/blob/main/LICENSE) [](https://bestpractices.coreinfrastructure.org/projects/4201)
[](https://twitter.com/tdenginedb) [](https://www.youtube.com/@tdengine) [](https://discord.com/invite/VZdSuUg4pS) [](https://www.linkedin.com/company/tdengine) [](https://stackoverflow.com/questions/tagged/tdengine) [](https://deepwiki.com/taosdata/TDengine) English | [简体中文](README-CN.md) | [TDengine Cloud](https://cloud.tdengine.com) | [了解更多关于 TSDB](https://tdengine.com/time-series-database/) # 目录 - [1. 介绍](#1-introduction) - [2. 文档](#2-documentation) - [3. 前置条件](#3-prerequisites) - [3.1 Linux 系统前置条件](#31-prerequisites-on-linux) - [3.1.1 Ubuntu 系统](#311-for-ubuntu) - [3.1.2 CentOS 系统](#312-for-centos) - [3.2 macOS 系统前置条件](#32-prerequisites-on-macos) - [3.3 Windows 系统前置条件](#33-prerequisites-on-windows) - [3.4 克隆仓库](#34-clone-the-repo) - [4. 构建](#4-building) - [4.1 在 Linux 上构建](#41-build-on-linux) - [4.2 在 macOS 上构建](#42-build-on-macos) - [4.3 在 Windows 上构建](#43-build-on-windows) - [5. 打包](#5-packaging) - [6. 安装](#6-installation) - [6.1 在 Linux 上安装](#61-install-on-linux) - [6.2 在 macOS 上安装](#62-install-on-macos) - [6.3 在 Windows 上安装](#63-install-on-windows) - [7. 运行](#7-running) - [7.1 在 Linux 上运行 TDengine](#71-run-tdengine-on-linux) - [7.2 在 macOS 上运行 TDengine](#72-run-tdengine-on-macos) - [7.3 在 Windows 上运行 TDengine](#73-run-tdengine-on-windows) - [8. 测试](#8-testing) - [9. 发布](#9-releasing) - [10. 工作流](#10-workflow) - [11. 覆盖率](#11-coverage) - [12. 贡献](#12-contributing) # 1. 介绍 TDengine 是一款开源、高性能、云原生且 AI 驱动的 [时序数据库](https://tdengine.com/tsdb/) (Time-Series Database),专为物联网 、联网汽车 和工业物联网 设计。它能够高效地对每天由数十亿个传感器和数据采集器生成的 TB 级甚至 PB 级数据进行实时摄入、处理和分析。TDengine 凭借以下优势与其他时序数据库区分开来: - **[高性能](https://tdengine.com/tdengine/high-performance-time-series-database/)**: TDengine 是唯一解决了高基数问题 的时序数据库,能够支持数十亿个数据采集点,同时在数据摄入、查询和数据压缩方面优于其他时序数据库。 - **[简化解决方案](https://tdengine.com/tdengine/simplified-time-series-data-solution/)**: 通过内置缓存、流处理、数据订阅和 AI Agent 功能,TDengine 为时序数据处理提供了简化的解决方案。它显著降低了系统设计复杂度和运营成本。 - **[云原生](https://tdengine.com/tdengine/cloud-native-time-series-database/)**: 通过原生分布式设计、分片和分区、存算分离、RAFT 一致性算法、支持 Kubernetes 部署以及全栈可观测性,TDengine 是一款云原生时序数据库,可部署在公有云、私有云或混合云上。 - **[AI 驱动](https://tdengine.com/tdengine/tdgpt/)**: 通过内置的 AI Agent TDgpt,TDengine 可以连接多种时序基础模型、大语言模型 (LLM)、机器学习算法和传统算法,提供时序数据预测、异常检测、数据填补 和分类功能。 - **[易用性](https://tdengine.com/tdengine/easy-time-series-data-platform/)**: 对于管理员,TDengine 显著减少了部署和维护的工作量。对于开发者,它提供了简单的接口、简化的解决方案以及与第三方工具的无缝集成。对于数据用户,它让数据访问变得更加容易。 - **[轻松数据分析](https://tdengine.com/tdengine/time-series-data-analytics-made-easy/)**: 通过超级表、存算分离、按时间间隔分区、预计算和 AI Agent,TDengine 使探索、格式化和访问数据变得高效且容易。 - **[开源](https://tdengine.com/tdengine/open-source-time-series-database/)**: TDengine 的核心模块,包括集群功能和 AI Agent,均在开源许可证下提供。它在 GitHub 上已获得 23.7k 星标。拥有活跃的开发者社区,全球运行实例超过 73 万个。 有关 TDengine 竞争优势的完整列表,请[点击这里查看](https://tdengine.com/tdengine/)。体验 TDengine 最简单的方式是通过 [TDengine Cloud](https://cloud.tdengine.com)。有关 TDengine 最新组件 TDgpt 的详细信息,请参阅 [TDgpt README](./tools/tdgpt/README.md)。 # 2. 文档 有关用户手册、系统设计和架构,请参阅 [TDengine Documentation](https://docs.tdengine.com) ([TDengine 文档](https://docs.taosdata.com)) 您可以选择通过 [容器](https://docs.tdengine.com/get-started/deploy-in-docker/)、[安装包](https://docs.tdengine.com/get-started/deploy-from-package/)、[Kubernetes](https://docs.tdengine.com/operations-and-maintenance/deploy-your-cluster/#kubernetes-deployment) 安装 TDengine,或者无需安装直接试用[全托管服务](https://cloud.tdengine.com/)。本快速指南面向希望自行贡献、构建、发布和测试 TDengine 的开发者。 如需贡献/构建/测试 TDengine 连接器,请查看以下仓库:[JDBC Connector](https://github.com/taosdata/taos-connector-jdbc), [Go Connector](https://github.com/taosdata/driver-go), [Python Connector](https://github.com/taosdata/taos-connector-python), [Node.js Connector](https://github.com/taosdata/taos-connector-node), [C# Connector](https://github.com/taosdata/taos-connector-dotnet), [Rust Connector](https://github.com/taosdata/taos-connector-rust)。 # 3. 前置条件 目前,TDengine 服务器支持在 Linux/macOS 系统上运行。任何应用程序也可以选择 taosAdapter 提供的 RESTful 接口来连接 taosd 服务。TDengine 支持 X64/ARM64 CPU,未来将支持 MIPS64、Alpha64、ARM32、RISC-V 等 CPU 架构。目前我们不支持在交叉编译环境下构建。 从 3.1.0.0 版本开始,TDengine 仅在 TSDB-Enterprise 版本中支持 Windows 系统。 如果您想编译 taosAdapter 或 taosKeeper,需要安装 Go 1.23 或更高版本。 ## 3.1 Linux 系统前置条件
在 Linux 上安装所需工具
### 3.1.1 Ubuntu 系统 已在 Ubuntu 18.04、20.04、22.04 上验证。 ``` sudo apt-get update sudo apt-get install -y gcc cmake build-essential git libjansson-dev \ libsnappy-dev liblzma-dev zlib1g-dev pkg-config libtool autoconf automake groff ``` ### 3.1.2 CentOS 系统 已在 CentOS 8 上验证。 ``` sudo yum update yum install -y epel-release gcc gcc-c++ make cmake git perl dnf-plugins-core autoconf automake libtool groff yum config-manager --set-enabled powertools yum install -y zlib-static xz-devel snappy-devel jansson-devel pkgconfig libatomic-static libstdc++-static ```在 macOS 上安装所需工具
请使用 [brew](https://brew.sh/) 安装依赖项。 ``` brew install argp-standalone gflags pkgconfig ```在 Linux 上构建的详细步骤
您可以运行 bash 脚本 `build.sh` 来构建 TDengine 和包括 taosBenchmark 和 taosdump 在内的 taosTools,如下所示: ``` ./build.sh ``` 这等同于执行以下命令: ``` mkdir debug && cd debug cmake .. -DBUILD_TOOLS=true -DBUILD_CONTRIB=true make ``` 如果您想编译 taosAdapter,需要添加 `-DBUILD_HTTP=false` 选项。 如果您想编译 taosKeeper,需要添加 `-DBUILD_KEEPER=true` 选项。 您可以使用 Jemalloc 作为内存分配器来代替 glibc: ``` cmake .. -DJEMALLOC_ENABLED=ON ``` TDengine 构建脚本可以在 x86、x86-64、arm64 平台上自动检测主机架构。 您也可以通过 CPUTYPE 选项手动指定架构: ``` cmake .. -DCPUTYPE=aarch64 && cmake --build . ```在 macOS 上构建的详细步骤
请安装 XCode 命令行工具和 cmake。已在 Catalina 和 Big Sur 系统上使用 XCode 11.4+ 验证。 ``` mkdir debug && cd debug cmake .. && cmake --build . ``` 如果您想编译 taosAdapter,需要添加 `-DBUILD_HTTP=false` 选项。 如果您想编译 taosKeeper,需要添加 `-DBUILD_KEEPER=true` 选项。在 Linux 上安装的详细步骤
构建成功后,可以通过以下方式安装 TDengine: ``` sudo make install ``` 从源代码安装也会为 TDengine 配置服务管理。用户也可以选择[从安装包安装](https://docs.tdengine.com/get-started/deploy-from-package/)。在 macOS 上安装的详细步骤
构建成功后,可以通过以下方式安装 TDengine: ``` sudo make install ```在 Linux 上运行的详细步骤
在 Linux 上安装后启动服务,在终端中使用: ``` sudo systemctl start taosd ``` 然后用户可以使用 TDengine CLI 连接 TDengine 服务器。在终端中使用: ``` taos ``` 如果 TDengine CLI 成功连接服务器,将打印欢迎消息和版本信息。否则,将显示错误消息。 如果您不想将 TDengine 作为服务运行,可以在当前 shell 中运行它。例如,要在构建后快速启动 TDengine 服务器,请在终端中运行以下命令:(我们以 Linux 为例,Windows 上的命令将是 `taosd.exe`) ``` ./build/bin/taosd -c test/cfg ``` 在另一个终端中,使用 TDengine CLI 连接服务器: ``` ./build/bin/taos -c test/cfg ``` 选项 `-c test/cfg` 指定系统配置文件目录。在 macOS 上运行的详细步骤
在 macOS 上安装后启动服务,双击 /applications/TDengine 启动程序,或者在终端中使用: ``` sudo launchctl start com.tdengine.taosd ``` 然后用户可以使用 TDengine CLI 连接 TDengine 服务器。在终端中使用: ``` taos ``` 如果 TDengine CLI 成功连接服务器,将打印欢迎消息和版本信息。否则,将显示错误消息。如何在本地运行覆盖率报告?
要在本地创建测试覆盖率报告(HTML 格式),请运行以下命令: ``` cd tests bash setup-lcov.sh -v 1.16 && ./run_local_coverage.sh -b main -c task # 在 main 分支上并运行 longtimeruning_cases.task 中的 cases # 欲了解更多关于 options 的信息,请参考 ./run_local_coverage.sh -h ```标签:Bash脚本, C/C++, IIoT, IoT, JS文件枚举, MITM代理, SQL, TDengine, TSDB, UML, 事务性I/O, 多线程, 大数据, 子域名突变, 实时分析, 客户端加密, 客户端加密, 工业物联网, 开源, 数据库, 日志审计, 智能制造, 物联网, 监控, 目录扫描, 系统审计, 请求拦截, 边缘计算, 逆向工具