diff --git a/.drone.yml b/.drone.yml index 457301b89ca1628d62ba50f2875ae612f7873bc1..d208d27e41bc92dde4c03b3e01dfe10cf7847112 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,32 +1,5 @@ --- kind: pipeline -name: test_amd64 - -platform: - os: linux - arch: amd64 - -steps: -- name: build - image: gcc - commands: - - apt-get update - - apt-get install -y cmake build-essential - - git submodule update --init --recursive - - mkdir debug - - cd debug - - cmake .. - - make -j4 - trigger: - event: - - pull_request - when: - branch: - - develop - - master - - 2.0 ---- -kind: pipeline name: test_arm64_bionic platform: @@ -37,7 +10,10 @@ steps: image: arm64v8/ubuntu:bionic commands: - apt-get update - - apt-get install -y cmake build-essential + - apt-get install -y cmake git build-essential wget + - wget https://dl.google.com/go/go1.16.9.linux-arm64.tar.gz + - tar -C /usr/local -xzf go1.16.9.linux-arm64.tar.gz + - export PATH=$PATH:/usr/local/go/bin - git submodule update --init --recursive - mkdir debug - cd debug @@ -65,7 +41,10 @@ steps: commands: - echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections - apt-get update - - apt-get install -y -qq cmake build-essential + - apt-get install -y -qq git cmake build-essential wget + - wget https://dl.google.com/go/go1.16.9.linux-arm64.tar.gz + - tar -C /usr/local -xzf go1.16.9.linux-arm64.tar.gz + - export PATH=$PATH:/usr/local/go/bin - git submodule update --init --recursive - mkdir debug - cd debug @@ -91,11 +70,18 @@ steps: - name: build image: arm64v8/centos:7 commands: - - yum install -y gcc gcc-c++ make cmake git + - yum install -y epel-release + - yum update + - yum install -y gcc gcc-c++ make cmake3 wget git + - wget https://dl.google.com/go/go1.16.9.linux-arm64.tar.gz + - tar -C /usr/local -xzf go1.16.9.linux-arm64.tar.gz + - export PATH=$PATH:/usr/local/go/bin + - ln -s /usr/bin/cmake3 /usr/bin/cmake + - go version - git submodule update --init --recursive - mkdir debug - cd debug - - cmake .. -DCPUTYPE=aarch64 > /dev/null + - cmake3 .. -DCPUTYPE=aarch64 > /dev/null - make -j4 trigger: event: @@ -117,7 +103,7 @@ steps: - name: build image: arm64v8/centos:8 commands: - - dnf install -y gcc gcc-c++ make cmake epel-release git libarchive + - dnf install -y gcc gcc-c++ make cmake epel-release git libarchive golang - git submodule update --init --recursive - mkdir debug - cd debug @@ -144,7 +130,7 @@ steps: image: arm32v7/ubuntu:bionic commands: - apt-get update - - apt-get install -y cmake build-essential + - apt-get install -y cmake build-essential golang-go git - git submodule update --init --recursive - mkdir debug - cd debug @@ -171,7 +157,10 @@ steps: image: ubuntu:trusty commands: - apt-get update - - apt-get install -y gcc cmake3 build-essential git binutils-2.26 + - apt-get install -y gcc cmake3 build-essential git binutils-2.26 wget + - wget https://dl.google.com/go/go1.16.9.linux-amd64.tar.gz + - tar -C /usr/local -xzf go1.16.9.linux-amd64.tar.gz + - export PATH=$PATH:/usr/local/go/bin - git submodule update --init --recursive - mkdir debug - cd debug @@ -198,7 +187,10 @@ steps: image: ubuntu:xenial commands: - apt-get update - - apt-get install -y gcc cmake build-essential + - apt-get install -y gcc cmake build-essential git wget + - wget https://dl.google.com/go/go1.16.9.linux-amd64.tar.gz + - tar -C /usr/local -xzf go1.16.9.linux-amd64.tar.gz + - export PATH=$PATH:/usr/local/go/bin - git submodule update --init --recursive - mkdir debug - cd debug @@ -224,7 +216,10 @@ steps: image: ubuntu:bionic commands: - apt-get update - - apt-get install -y gcc cmake build-essential + - apt-get install -y gcc cmake build-essential git wget + - wget https://dl.google.com/go/go1.16.9.linux-amd64.tar.gz + - tar -C /usr/local -xzf go1.16.9.linux-amd64.tar.gz + - export PATH=$PATH:/usr/local/go/bin - git submodule update --init --recursive - mkdir debug - cd debug @@ -249,11 +244,17 @@ steps: - name: build image: ansible/centos7-ansible commands: - - yum install -y gcc gcc-c++ make cmake + - yum install -y epel-release + - yum update + - yum install -y gcc gcc-c++ make cmake3 wget git + - wget https://dl.google.com/go/go1.16.9.linux-amd64.tar.gz + - tar -C /usr/local -xzf go1.16.9.linux-amd64.tar.gz + - export PATH=$PATH:/usr/local/go/bin + - ln -s /usr/bin/cmake3 /usr/bin/cmake - git submodule update --init --recursive - mkdir debug - cd debug - - cmake .. + - cmake3 .. - make -j4 trigger: event: diff --git a/CMakeLists.txt b/CMakeLists.txt index 093731f190a380539cca3db8f8c12793d4b6557c..489cb5b197a0d4a1e09f8167a435cce382148fec 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,9 +10,9 @@ ELSE () ENDIF () IF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) + CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) ELSE () - CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + CMAKE_MINIMUM_REQUIRED(VERSION 3.0) ENDIF () SET(TD_ACCOUNT FALSE) @@ -38,7 +38,7 @@ MESSAGE(STATUS "Community directory: " ${TD_COMMUNITY_DIR}) INCLUDE(cmake/input.inc) INCLUDE(cmake/platform.inc) -IF (TD_WINDOWS OR TD_DARWIN) +IF (TD_WINDOWS OR TD_DARWIN) SET(TD_SOMODE_STATIC TRUE) ENDIF () diff --git a/Jenkinsfile b/Jenkinsfile index 1a05f42384cce6a1308838f51e397ad81aed30a9..1909f36ea9bf151cc4c85b492e7581ccbff8be3a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -99,7 +99,7 @@ def pre_test(){ sh ''' cd ${WK} git pull >/dev/null - git submodule update --init --recursive + export TZ=Asia/Harbin date git clean -dfx @@ -149,6 +149,7 @@ def pre_test_win(){ git fetch origin +refs/pull/%CHANGE_ID%/merge git checkout -qf FETCH_HEAD git clean -dfx + git submodule update --init --recursive cd C:\\workspace\\TDinternal git reset --hard HEAD~10 ''' @@ -469,35 +470,35 @@ pipeline { } } - stage('build'){ - agent{label " wintest "} - steps { - pre_test() - script{ - while(win_stop == 0){ - sleep(1) - } - } - } - } - stage('test'){ - agent{label "win"} - steps{ + // stage('build'){ + // agent{label " wintest "} + // steps { + // pre_test() + // script{ + // while(win_stop == 0){ + // sleep(1) + // } + // } + // } + // } + // stage('test'){ + // agent{label "win"} + // steps{ - catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { - pre_test_win() - timeout(time: 20, unit: 'MINUTES'){ - bat''' - cd C:\\workspace\\TDinternal\\community\\tests\\pytest - .\\test-all.bat Wintest - ''' - } - } - script{ - win_stop=1 - } - } - } + // catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { + // pre_test_win() + // timeout(time: 20, unit: 'MINUTES'){ + // bat''' + // cd C:\\workspace\\TDinternal\\community\\tests\\pytest + // .\\test-all.bat Wintest + // ''' + // } + // } + // script{ + // win_stop=1 + // } + // } + // } } diff --git a/README.md b/README.md index 4755562fd57a2d85283c2f05b94c1b8b097a0c64..d87843080c4d3de0e8785c541d6b2714af61df4e 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![TDengine](TDenginelogo.png)](https://www.taosdata.com) -English | [简体中文](./README-CN.md) +English | [简体中文](./README-CN.md) We are hiring, check [here](https://www.taosdata.com/en/careers/) # What is TDengine? @@ -32,7 +32,7 @@ For user manual, system design and architecture, engineering blogs, refer to [TD # Building At the moment, TDengine only supports building and running on Linux systems. You can choose to [install from packages](https://www.taosdata.com/en/getting-started/#Install-from-Package) or from the source code. This quick guide is for installation from the source only. -To build TDengine, use [CMake](https://cmake.org/) 2.8.12.x or higher versions in the project directory. +To build TDengine, use [CMake](https://cmake.org/) 3.0.2 or higher versions in the project directory. ## Install tools @@ -47,7 +47,7 @@ sudo apt-get install -y gcc cmake3 build-essential git binutils-2.26 export PATH=/usr/lib/binutils-2.26/bin:$PATH ``` -To compile and package the JDBC driver source code, you should have a Java jdk-8 or higher and Apache Maven 2.7 or higher installed. +To compile and package the JDBC driver source code, you should have a Java jdk-8 or higher and Apache Maven 2.7 or higher installed. To install openjdk-8: ```bash sudo apt-get install -y openjdk-8-jdk @@ -60,7 +60,10 @@ sudo apt-get install -y maven ### Centos 7: ```bash -sudo yum install -y gcc gcc-c++ make cmake git +sudo yum install epel-release +sudo yum update +sudo yum install -y gcc gcc-c++ make cmake3 git +sudo ln -sf /usr/bin/cmake3 /usr/bin/cmake ``` To install openjdk-8: @@ -94,7 +97,7 @@ TDengine includes few components developed by Go language. Please refer to golan Please use version 1.14+. For the user in China, we recommend using a proxy to accelerate package downloading. ``` go env -w GO111MODULE=on -go env -w GOPROXY=https://goproxy.io,direct +go env -w GOPROXY=https://goproxy.cn,direct ``` ## Get the source codes @@ -236,7 +239,7 @@ In another terminal, use the TDengine shell to connect the server: ./build/bin/taos -c test/cfg ``` -option "-c test/cfg" specifies the system configuration file directory. +option "-c test/cfg" specifies the system configuration file directory. # Try TDengine It is easy to run SQL commands from TDengine shell which is the same as other SQL databases. diff --git a/cmake/define.inc b/cmake/define.inc index 68f889cd4473b71491af4e8cd8588ae7db81e3a0..10134a94d2e5d40b7528af1ca205105d3235c6d2 100755 --- a/cmake/define.inc +++ b/cmake/define.inc @@ -125,8 +125,13 @@ IF (TD_APLHINE) ENDIF () IF (TD_LINUX) - IF (TD_BUILD_HTTP) + IF (TD_ARM_32) + SET(TD_BUILD_HTTP TRUE) ADD_DEFINITIONS(-DHTTP_EMBEDDED) + ELSE () + IF (TD_BUILD_HTTP) + ADD_DEFINITIONS(-DHTTP_EMBEDDED) + ENDIF () ENDIF () ELSE () SET(TD_BUILD_HTTP TRUE) diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index 516c752bd101f26f04c3986ed50edd55121c5a40..45828245e2d541114a2ae0a287e0c6acbd0d42be 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -1,9 +1,9 @@ PROJECT(TDengine) IF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) + CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) ELSE () - CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + CMAKE_MINIMUM_REQUIRED(VERSION 3.0) ENDIF () ADD_SUBDIRECTORY(zlib-1.2.11) diff --git a/deps/MQTT-C/CMakeLists.txt b/deps/MQTT-C/CMakeLists.txt index 37959140e70d4808c845e3ca6e415ce8bdecf3ac..38e5f4db21c65d2043a86173a92f9d08d84de586 100644 --- a/deps/MQTT-C/CMakeLists.txt +++ b/deps/MQTT-C/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) # MQTT-C build options option(MQTT_C_OpenSSL_SUPPORT "Build MQTT-C with OpenSSL support?" OFF) diff --git a/deps/MsvcLibX/CMakeLists.txt b/deps/MsvcLibX/CMakeLists.txt index 4197f502b131b8dc7ae289fd822e15f8a6522cbf..34cb0bbef84dacba78d3579ce8955559688bb433 100644 --- a/deps/MsvcLibX/CMakeLists.txt +++ b/deps/MsvcLibX/CMakeLists.txt @@ -1,9 +1,9 @@ PROJECT(TDengine) IF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) + CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) ELSE () - CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + CMAKE_MINIMUM_REQUIRED(VERSION 3.0) ENDIF () IF (TD_WINDOWS) diff --git a/deps/iconv/CMakeLists.txt b/deps/iconv/CMakeLists.txt index ab5fa1a5d1f409496118dc6212fb6f1512b51bb2..0fd7520a8d3afbcb92d2c5dd1b9f23fc9bc7d60c 100644 --- a/deps/iconv/CMakeLists.txt +++ b/deps/iconv/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) IF (TD_WINDOWS) diff --git a/deps/pthread/CMakeLists.txt b/deps/pthread/CMakeLists.txt index 16d03f3590bf933c383dd1294b1117fd9f95ad7a..b467fa8e2c8d4b6eb8fd416addcb4c0881a6339e 100644 --- a/deps/pthread/CMakeLists.txt +++ b/deps/pthread/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) IF (TD_WINDOWS) diff --git a/deps/regex/CMakeLists.txt b/deps/regex/CMakeLists.txt index 05d01f02efa4c731bb67f6f5f654b499f6f2be03..442451920b22de3da8b476d5442abf4ec8a48d20 100644 --- a/deps/regex/CMakeLists.txt +++ b/deps/regex/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) IF (TD_WINDOWS) diff --git a/deps/wepoll/CMakeLists.txt b/deps/wepoll/CMakeLists.txt index e9b7749d82e381e7002f7bca65dc6d5a4e1a7740..77c915c13b248c34c4a8183a8a4f4559c74c7929 100644 --- a/deps/wepoll/CMakeLists.txt +++ b/deps/wepoll/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) IF (TD_WINDOWS) diff --git a/deps/zlib-1.2.11/CMakeLists.txt b/deps/zlib-1.2.11/CMakeLists.txt index 1220cc4246b4cef9b0709e2f14dec46ba787c4cc..75c2298f23dd3a213952ad9d65272ae3cf91de00 100644 --- a/deps/zlib-1.2.11/CMakeLists.txt +++ b/deps/zlib-1.2.11/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) IF (TD_WINDOWS) diff --git a/documentation20/cn/00.index/docs.md b/documentation20/cn/00.index/docs.md index 8f22a1d85e13dc88ee78ad2ed1450933707cce3b..24654ed407ea121c627e0488888a455f9a858646 100644 --- a/documentation20/cn/00.index/docs.md +++ b/documentation20/cn/00.index/docs.md @@ -53,6 +53,8 @@ TDengine是一个高效的存储、查询、分析时序大数据的平台,专 * [Schemaless 写入](/insert#schemaless):免于预先建表,将数据直接写入时自动维护元数据结构 * [Prometheus 写入](/insert#prometheus):配置Prometheus, 不用任何代码,将数据直接写入 * [Telegraf 写入](/insert#telegraf):配置Telegraf, 不用任何代码,将采集数据直接写入 +* [collectd 直接写入](/insert#collectd):配置 collectd,不用任何代码,将采集数据直接写入 +* [StatsD 直接写入](/insert#statsd):配置 StatsD,不用任何代码,将采集数据直接写入 * [EMQ X Broker](/insert#emq):配置EMQ X,不用任何代码,就可将MQTT数据直接写入 * [HiveMQ Broker](/insert#hivemq):配置HiveMQ,不用任何代码,就可将MQTT数据直接写入 diff --git a/documentation20/cn/05.insert/docs.md b/documentation20/cn/05.insert/docs.md index f9d10c6586688d813f42c2f36e3c811201e9b0a9..3dfb94562930946e0de17cfaf42bea24b3efbd81 100644 --- a/documentation20/cn/05.insert/docs.md +++ b/documentation20/cn/05.insert/docs.md @@ -1,6 +1,6 @@ # 高效写入数据 -TDengine支持多种接口写入数据,包括SQL, Prometheus, Telegraf, EMQ MQTT Broker, HiveMQ Broker, CSV文件等,后续还将提供Kafka, OPC等接口。数据可以单条插入,也可以批量插入,可以插入一个数据采集点的数据,也可以同时插入多个数据采集点的数据。支持多线程插入,支持时间乱序数据插入,也支持历史数据插入。 +TDengine支持多种接口写入数据,包括SQL,Prometheus,Telegraf,collectd,StatsD,EMQ MQTT Broker,HiveMQ Broker,CSV文件等,后续还将提供Kafka,OPC等接口。数据可以单条插入,也可以批量插入,可以插入一个数据采集点的数据,也可以同时插入多个数据采集点的数据。支持多线程插入,支持时间乱序数据插入,也支持历史数据插入。 ## SQL 写入 @@ -98,7 +98,7 @@ Schemaless 按照如下原则来处理行数据: 用户需要从github下载[Bailongma](https://github.com/taosdata/Bailongma)的源码,使用Golang语言编译器编译生成可执行文件。在开始编译前,需要准备好以下条件: - Linux操作系统的服务器 -- 安装好Golang,1.10版本以上 +- 安装好Golang,1.14版本以上 - 对应的TDengine版本。因为用到了TDengine的客户端动态链接库,因此需要安装好和服务端相同版本的TDengine程序;比如服务端版本是TDengine 2.0.0, 则在Bailongma所在的Linux服务器(可以与TDengine在同一台服务器,或者不同服务器) Bailongma项目中有一个文件夹blm_prometheus,存放了prometheus的写入API程序。编译过程如下: @@ -184,12 +184,14 @@ select * from apiserver_request_latencies_bucket; ``` ## Telegraf 直接写入(通过 BLM v3) -TDengine 新版本(2.3.0.0+)将包含一个 BLM3 独立程序,负责接受其他多种应用的数据写入。 +安装 Telegraf 请参考[官方文档](https://portal.influxdata.com/downloads/)。 + +TDengine 新版本(2.3.0.0+)包含一个 BLM3 独立程序,负责接收包括 Telegraf 的多种应用的数据写入。 -配置方法,假设 TDengine 和 Telegraf 在同一台机器上部署,且假设 TDengine 使用默认用户名 root 和密码 taosdata。在 /etc/telegraf/telegraf.conf 增加如下文字: +配置方法,假设 TDengine 使用默认用户名 root 和密码 taosdata。在 /etc/telegraf/telegraf.conf 增加如下文字: ``` [[outputs.http]] - url = "http://127.0.0.1:6041/influxdb/v1/write?db=metrics" + url = "http://:6041/influxdb/v1/write?db=metrics" method = "POST" timeout = "5s" username = "root" @@ -207,16 +209,15 @@ sudo systemctl start telegraf BLM v3 相关配置参数请参考 blm3 --help 命令输出以及相关文档。 ## collectd 直接写入(通过 BLM v3) -安装 collectd -``` -apt-get install collectd -``` +安装 collectd,请参考[官方文档](https://collectd.org/download.shtml)。 + +TDengine 新版本(2.3.0.0+)包含一个 BLM3 独立程序,负责接收包括 collectd 的多种应用的数据写入。 在 /etc/collectd/collectd.conf 文件中增加如下内容: ``` LoadPlugin network - Server "192.168.17.180" "25826" + Server "" "25826" ``` 重启 collectd @@ -227,20 +228,17 @@ BLM v3 相关配置参数请参考 blm3 --help 命令输出以及相关文档。 ## StatsD 直接写入(通过 BLM v3) 安装 StatsD -``` -1. git clone https://github.com/etsy/statsd.git -2. cd statsd -3. cp exampleConfig.js config.js -4. node stats.js config.js -``` +请参考[官方文档](https://github.com/statsd/statsd)。 + +TDengine 新版本(2.3.0.0+)包含一个 BLM3 独立程序,负责接收包括 StatsD 的多种应用的数据写入。 在 config.js 文件中增加如下内容后启动 StatsD: ``` backends 部分添加 "./backends/repeater" -repeater 部分添加 { host:'host to blm3', port: 8126 } +repeater 部分添加 { host:'', port: 8126 } ``` -实例配置文件: +示例配置文件: ``` { port: 8125 diff --git a/documentation20/cn/08.connector/docs.md b/documentation20/cn/08.connector/docs.md index 8cf3a889ceedb6cedcb5b7f1e581297b61986bcd..bbac768316e47e34ea56107eed81416f518cd42a 100644 --- a/documentation20/cn/08.connector/docs.md +++ b/documentation20/cn/08.connector/docs.md @@ -407,9 +407,9 @@ typedef struct TAOS_MULTI_BIND { 除了使用 SQL 方式或者使用参数绑定 API 写入数据外,还可以使用 Schemaless 的方式完成写入。Schemaless 可以免于预先创建超级表/数据子表的数据结构,而是可以直接写入数据,TDengine 系统会根据写入的数据内容自动创建和维护所需要的表结构。Schemaless 的使用方式详见 [Schemaless 写入](https://www.taosdata.com/cn/documentation/insert#schemaless) 章节,这里介绍与之配套使用的 C/C++ API。 +2.2.0.0版本接口: - `int taos_insert_lines(TAOS* taos, char* lines[], int numLines)` - (2.2.0.0 版本新增) 以 Schemaless 格式写入多行数据。其中: * taos:调用 taos_connect 返回的数据库连接。 * lines:由 char 字符串指针组成的数组,指向本次想要写入数据库的多行数据。 @@ -421,6 +421,65 @@ typedef struct TAOS_MULTI_BIND { 1. 此接口是一个同步阻塞式接口,使用时机与 `taos_query()` 一致。 2. 在调用此接口之前,必须先调用 `taos_select_db()` 来确定目前是在向哪个 DB 来写入。 +2.3.0.0版本接口: +- `int taos_schemaless_insert(TAOS* taos, const char* lines[], int numLines, int protocol, const char* precision, int* affectedRows, char* msg, int msgBufLen)` + **参数说明** + taos: 数据库连接,通过taos_connect 函数建立的数据库连接。 + lines:文本数据。满足解析格式要求的无模式文本字符串。 + numLines:文本数据的行数,不能为 0 。 + protocol: 行协议类型,用于标识文本数据格式。 + precision:文本数据中的时间戳精度字符串。 + affectedRows:插入操作完成以后,正确写入到数据库中的记录行数。 + msg: 如果出现错误(函数返回值不为 0)情况下,错误提示信息。该参数是输入参数,需要用户指定消息输出缓冲区,如果不指定该缓冲区(输入为NULL),即使出现错误也不会得到错误提示信息。 + msgBufLen: 缓冲区的长度,避免错误提示消息越界。 + + **返回值** + 0:无错误发生。 + 非 0 值:发生了错误。此时可以通过msg获取错误信息的提示。该返回值含义可以参考taoserror.h文件中的错误码定义。 + + **说明** + 协议类型是枚举类型,包含以下三种格式: + SML_LINE_PROTOCOL:InfluxDB行协议(Line Protocol) + SML_TELNET_PROTOCOL: OpenTSDB文本行协议 + SML_JSON_PROTOCOL: OpenTSDB Json协议格式 + + 时间戳分辨率的说明使用如下字符串:“h“ (小时)、”m“(分钟)、”s“ (秒) ”ms“(毫秒)、”u“ (微秒)、”ns”(纳秒),不区分大小写。需要注意的是,时间戳分辨率参数只在协议类型为 SML_LINE_PROTOCOL 的时候生效。对于 OpenTSDB的文本协议,时间戳的解析遵循其官方解析规则 — 按照时间戳包含的字符的数量来确认时间精度。 + +```c +#include +#include +#include + +int main() { + const char* host = "127.0.0.1"; + const char* user = "root"; + const char* passwd = "taosdata"; + + // error message buffer + char msg[512] = {0}; + + // connect to server + TAOS* taos = taos_connect(host, user, passwd, "test", 0); + + // prepare the line string + char* lines1[] = { + "stg,t1=3i64,t2=4f64,t3=\"t3\" c1=3i64,c3=L\"passit\",c2=false,c4=4f64 1626006833639000000", + "stg,t1=4i64,t3=\"t4\",t2=5f64,t4=5f64 c1=3i64,c3=L\"passitagin\",c2=true,c4=5f64,c5=5f64 1626006833641000000" + }; + + // schema-less insert + int code = taos_schemaless_insert(taos, lines1, 2, SML_LINE_PROTOCOL, "ns", msg, sizeof(msg)/sizeof(msg[0])); + if (code != 0) { + printf("failed to insert schema-less data, reason: %s\n", msg); + } + + // close the connection + taos_close(taos); + return (code); +} +``` +**注**:后续2.2.0.0版本也更新成2.3.0.0版本的接口。 + ### 连续查询接口 TDengine提供时间驱动的实时流式计算API。可以每隔一指定的时间段,对一张或多张数据库的表(数据流)进行各种实时聚合计算操作。操作简单,仅有打开、关闭流的API。具体如下: diff --git a/documentation20/cn/12.taos-sql/docs.md b/documentation20/cn/12.taos-sql/docs.md index 8e62ab1ae5b10f4f1bd43a98c7eaaa2c97349f40..ebf344ca94200d37585cc9af57b91cccaedc3a5c 100644 --- a/documentation20/cn/12.taos-sql/docs.md +++ b/documentation20/cn/12.taos-sql/docs.md @@ -1472,6 +1472,39 @@ Query OK, 1 row(s) in set (0.001238s) Query OK, 1 row(s) in set (0.000836s) ``` +- **CEIL** + ```mysql + SELECT CEIL(field_name) FROM { tb_name | stb_name } [WHERE clause]; + ``` + 功能说明:获得指定列的向上取整数的结果。 + + 返回结果类型:与指定列的原始数据类型一致。例如,如果指定列的原始数据类型为 Float,那么返回的数据类型也为 Float;如果指定列的原始数据类型为 Double,那么返回的数据类型也为 Double。 + + 适用数据类型:不能应用在 timestamp、binary、nchar、bool 类型字段上;在超级表查询中使用时,不能应用在 tag 列,无论 tag 列的类型是什么类型。 + + 嵌套子查询支持:适用于内层查询和外层查询。 + + 说明: + 支持 +、-、*、/ 运算,如 ceil(col1) + ceil(col2)。 + 只能与普通列,选择(Selection)、投影(Projection)函数一起使用,不能与聚合(Aggregation)函数一起使用。 + 该函数可以应用在普通表和超级表上。 + + 支持版本:指定计算算法的功能从 2.2.0.x 版本开始,2.2.0.0 之前的版本不支持指定使用算法的功能。 + +- **FLOOR** + ```mysql + SELECT FLOOR(field_name) FROM { tb_name | stb_name } [WHERE clause]; + ``` + 功能说明:获得指定列的向下取整数的结果。 + 其他使用说明参见CEIL函数描述。 + +- **ROUND** + ```mysql + SELECT ROUND(field_name) FROM { tb_name | stb_name } [WHERE clause]; + ``` + 功能说明:获得指定列的四舍五入的结果。 + 其他使用说明参见CEIL函数描述。 + - **四则运算** ```mysql diff --git a/documentation20/cn/14.devops/01.telegraf/docs.md b/documentation20/cn/14.devops/01.telegraf/docs.md index 8a6a7e48eab6dbecedd809ea9bf39234c81126d5..c9ffe0342b10349b562f49105a1c5e277fc3c4a5 100644 --- a/documentation20/cn/14.devops/01.telegraf/docs.md +++ b/documentation20/cn/14.devops/01.telegraf/docs.md @@ -17,33 +17,16 @@ IT 运维监测数据通常都是对时间特性比较敏感的数据,例如 ## 安装步骤 ### 安装 Telegraf,Grafana 和 TDengine -安装 Telegraf 和 Grafana 请参考相关官方文档,这里仅假设使用 Ubuntu 20.04 LTS 为操作系统为例。 +安装 Telegraf、Grafana 和 TDengine 请参考相关官方文档。 ### Telegraf -``` -1. wget -qO- https://repos.influxdata.com/influxdb.key | sudo apt-key add - -2. source /etc/lsb-release -3. echo "deb https://repos.influxdata.com/${DISTRIB_ID,,} ${DISTRIB_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/influxdb.list -4. sudo apt-get update -5. sudo apt-get install telegraf -6. sudo systemctl start telegraf -``` +请参考[官方文档](https://portal.influxdata.com/downloads/)。 ### Grafana -``` -1. wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - -2. echo "deb https://packages.grafana.com/enterprise/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list -3. sudo apt-get update -4. sudo apt-get install grafana -5. sudo systemctl start grafana-server.service -``` +请参考[官方文档](https://grafana.com/grafana/download)。 ### 安装 TDengine -从涛思数据官网下载页面 (http://taosdata.com/cn/all-downloads/)最新 TDengine-server 2.3.0.0 版本,以 deb 安装包为例。 -``` -1. sudo dpkg -i TDengine-server-2.3.0.0-Linux-x64.deb -2. sudo systemctl start taosd -``` +从涛思数据官网[下载](http://taosdata.com/cn/all-downloads/)页面下载最新 TDengine-server 2.3.0.0 或以上版本安装。 ## 数据链路设置 @@ -56,10 +39,10 @@ IT 运维监测数据通常都是对时间特性比较敏感的数据,例如 ``` ### 修改 /etc/telegraf/telegraf.conf -假设 TDengine 和 Telegraf 在同一台机器上部署,且假设 TDengine 使用默认用户名 root 和密码 taosdata。增加如下文字: +假设 TDengine 使用默认用户名 root 和密码 taosdata。增加如下文字: ``` [[outputs.http]] - url = "http://127.0.0.1:6041/influxdb/v1/write?db=metrics" + url = "http://:6041/influxdb/v1/write?db=metrics" method = "POST" timeout = "5s" username = "root" @@ -77,7 +60,7 @@ sudo systemctl start telegraf 使用 Web 浏览器访问 IP:3000 登录 Grafana 界面,系统初始用户名密码为 admin/admin。 点击左侧齿轮图标并选择 Plugins,应该可以找到 TDengine data source 插件图标。 -点击左侧加号图标并选择 Import,按照界面提示选择 /usr/local/taos/connector/grafanaplugin/examples/telegraf/grafana/dashboards/telegraf-dashboard-v0.1.0.json 文件,然后应该可以看到如下界面的仪表板界面: +点击左侧加号图标并选择 Import,按照界面提示选择 /usr/local/taos/connector/grafanaplugin/examples/telegraf/grafana/dashboards/telegraf-dashboard-v0.1.0.json 文件。如果按照 Grafana 的机器上没有安装 TDengine,可以从 https://github.com/taosdata/grafanaplugin/blob/master/examples/telegraf/grafana/dashboards/telegraf-dashboard-v0.1.0.json 下载 dashboard JSON 文件再导入。之后可以看到如下界面的仪表盘: ![IT-DevOps-Solutions-telegraf-dashboard.png](../../images/IT-DevOps-Solutions-telegraf-dashboard.png) diff --git a/documentation20/cn/14.devops/02.collectd/docs.md b/documentation20/cn/14.devops/02.collectd/docs.md index 7aec7dd08de7e276ee918b41390f2f94045d37a8..7d391c8b80d77de4d178ce160417c1107dbb9d83 100644 --- a/documentation20/cn/14.devops/02.collectd/docs.md +++ b/documentation20/cn/14.devops/02.collectd/docs.md @@ -14,34 +14,19 @@ IT 运维监测数据通常都是对时间特性比较敏感的数据,例如 ![IT-DevOps-Solutions-Collectd-StatsD.png](../../images/IT-DevOps-Solutions-Collectd-StatsD.png) ## 安装步骤 -安装 collectd, StatsD, Grafana 和 TDengine 请参考相关官方文档,这里仅假设使用 Ubuntu 20.04 LTS 为操作系统为例。 +安装 collectd, StatsD, Grafana 和 TDengine 请参考相关官方文档。 ### 安装 collectd -``` -apt-get install collectd -``` +请参考[官方文档](https://collectd.org/documentation.shtml)。 + ### 安装 StatsD -``` -1. git clone https://github.com/etsy/statsd.git -2. cd statsd -3. cp exampleConfig.js config.js -4. node stats.js config.js -``` +请参考[官方文档](https://github.com/statsd/statsd)。 ### 安装 Grafana -``` -1. wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - -2. echo "deb https://packages.grafana.com/enterprise/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list -3. sudo apt-get update -4. sudo apt-get install grafana -5. sudo systemctl start grafana-server.service -``` +请参考[官方文档](https://grafana.com/grafana/download)。 + ### 安装 TDengine -从涛思数据官网下载页面 (http://taosdata.com/cn/all-downloads/)最新 TDengine-server 2.3.0.0 版本,以 deb 安装包为例。 -``` -1. sudo dpkg -i TDengine-server-2.3.0.0-Linux-x64.deb -2. sudo systemctl start taosd -``` +从涛思数据官网[下载](http://taosdata.com/cn/all-downloads/)页面下载最新 TDengine-server 2.3.0.0 或以上版本安装。 ## 数据链路设置 ### 复制 TDengine 插件到 grafana 插件目录 @@ -57,7 +42,7 @@ apt-get install collectd ``` LoadPlugin network - Server "192.168.17.180" "25826" + Server "" "25826" sudo systemctl start collectd @@ -67,7 +52,7 @@ sudo systemctl start collectd 在 config.js 文件中增加如下内容后启动 StatsD: ``` backends 部分添加 "./backends/repeater" -repeater 部分添加 { host:'host to blm3', port: 8126 } +repeater 部分添加 { host:'', port: 8126 } ``` ### 导入 Dashboard @@ -77,14 +62,14 @@ repeater 部分添加 { host:'host to blm3', port: 8126 } #### 导入 collectd 仪表盘 -点击左侧加号图标并选择 Import,按照界面提示选择 /usr/local/taos/connector/grafanaplugin/examples/telegraf/grafana/dashboards/telegraf-dashboard-v0.1.0.json 文件,然后应该可以看到如下界面的仪表板界面: +点击左侧加号图标并选择 Import,按照界面提示选择 /usr/local/taos/connector/grafanaplugin/examples/collectd/grafana/dashboards/collect-metrics-with-tdengine-v0.1.0.json 文件。如果按照 Grafana 的机器上没有安装 TDengine,可以从 https://github.com/taosdata/grafanaplugin/blob/master/examples/collectd/grafana/dashboards/collect-metrics-with-tdengine-v0.1.0.json 下载 dashboard json 文件再导入。之后可以看到如下界面的仪表盘: ![IT-DevOps-Solutions-collectd-dashboard.png](../../images/IT-DevOps-Solutions-collectd-dashboard.png) #### 导入 StatsD 仪表盘 -点击左侧加号图标并选择 Import,按照界面提示选择 /usr/local/taos/connector/grafanaplugin/examples/collectd/grafana/dashboards/collect-metrics-with-tdengine-v0.1.0.json 文件,然后应该可以看到如下界面的仪表板界面: -![IT-DevOps-Solutions-collectd-dashboard.png](../../images/IT-DevOps-Solutions-collectd-dashboard.png) +点击左侧加号图标并选择 Import,按照界面提示选择 /usr/local/taos/connector/grafanaplugin/examples/statsd/dashboards/statsd-with-tdengine-v0.1.0.json 文件。如果安装 Grafana 的机器上没有安装 TDengine,可以从 https://github.com/taosdata/grafanaplugin/blob/master/examples/statsd/dashboards/statsd-with-tdengine-v0.1.0.json 下载 dashboard json 文件再导入。之后可以看到如下界面的仪表盘: +![IT-DevOps-Solutions-statsd-dashboard.png](../../images/IT-DevOps-Solutions-statsd-dashboard.png) ## 总结 TDengine 作为新兴的时序大数据平台,具备极强的高性能、高可靠、易管理、易维护的优势。得力于 TDengine 2.3.0.0 版本中新增的 schemaless 协议解析功能,以及强大的生态软件适配能力,用户可以短短数分钟就可以搭建一个高效易用的 IT 运维系统或者适配一个已存在的系统。 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f480996cefeb95b67c3b2b46a97f41899f8e0583..8186c420845971efd617475d4293abccabc27c47 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) # Base compile diff --git a/src/balance/CMakeLists.txt b/src/balance/CMakeLists.txt index bffa415deb7cc3ebe15082051ebd22a81e45c899..5dcff7a214f818f0d240988e9832bb9b188904e4 100644 --- a/src/balance/CMakeLists.txt +++ b/src/balance/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/mnode/inc) diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt index 4eb0d2b2bfdd1d42ec93a85083c2f0fc0382af5a..e508b66a16a0c14f99ac6cbd14445882f42513c3 100644 --- a/src/client/CMakeLists.txt +++ b/src/client/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) INCLUDE_DIRECTORIES(inc) diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index d5b1464f4f334db6b385637aa157fec16fcded5f..ed6c81bff6d277615ba45b453c65182ac6a03d82 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -7360,7 +7360,7 @@ int32_t validateFunctionFromUpstream(SQueryInfo* pQueryInfo, char* msg) { SQueryInfo* pUp = taosArrayGetP(pQueryInfo->pUpstream, j); STableMetaInfo *pTableMetaInfo = tscGetMetaInfo(pUp, 0); bool isSTable = UTIL_TABLE_IS_SUPER_TABLE(pTableMetaInfo); - if ((!isSTable) || groupbyTbname(pUp)) { + if ((!isSTable) || groupbyTbname(pUp)||pUp->interval.interval > 0) { return TSDB_CODE_SUCCESS; } } diff --git a/src/client/tests/CMakeLists.txt b/src/client/tests/CMakeLists.txt index 5de18942acbb5b3ac59d2496728c500b63246fe9..6ba6d5f6a800f63989249afbaaf6973708963745 100644 --- a/src/client/tests/CMakeLists.txt +++ b/src/client/tests/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) FIND_PATH(HEADER_GTEST_INCLUDE_DIR gtest.h /usr/include/gtest /usr/local/include/gtest) diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 4dce63e54f5db2b56c569bf6564899236c24a421..14f6733e5122511b2baa40fb09a2315da633cc19 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) INCLUDE_DIRECTORIES(inc) diff --git a/src/connector/jdbc/CMakeLists.txt b/src/connector/jdbc/CMakeLists.txt index 1e5cede714820f29defe3c6b458b2daf467bc4d2..065dedac63372f5c71146ee9937a6e136d71ce81 100644 --- a/src/connector/jdbc/CMakeLists.txt +++ b/src/connector/jdbc/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) diff --git a/src/connector/odbc/CMakeLists.txt b/src/connector/odbc/CMakeLists.txt index 87746f23ae3796f4d0ab20257f90599860430568..d955d0c238099a488ea693d1aedf62f0494ca0f7 100644 --- a/src/connector/odbc/CMakeLists.txt +++ b/src/connector/odbc/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) IF (TD_LINUX_64) diff --git a/src/connector/odbc/src/CMakeLists.txt b/src/connector/odbc/src/CMakeLists.txt index e990647e1aadcafb8b3306ee7e43a4d3ac285c94..3fe9e19d5fbaeecb93a05840da147c503f115f08 100644 --- a/src/connector/odbc/src/CMakeLists.txt +++ b/src/connector/odbc/src/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) add_subdirectory(base) diff --git a/src/connector/odbc/src/base/CMakeLists.txt b/src/connector/odbc/src/base/CMakeLists.txt index e34091360900a3a856d9fe56bb9fec994f4ba321..7e731334ed27f43f12d411ac329dc34df971ffaa 100644 --- a/src/connector/odbc/src/base/CMakeLists.txt +++ b/src/connector/odbc/src/base/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) aux_source_directory(. SRC) diff --git a/src/cq/CMakeLists.txt b/src/cq/CMakeLists.txt index f01ccb8728eb9a2a4695a8a0c133422e3134b8e2..bd9e3544215bf5957c4f88b8eb884c24e375385f 100644 --- a/src/cq/CMakeLists.txt +++ b/src/cq/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) INCLUDE_DIRECTORIES(inc) diff --git a/src/cq/test/CMakeLists.txt b/src/cq/test/CMakeLists.txt index d713dd7401c4f2d791ee0b4de1216b6ede558507..1682d2fbf9399f791664f37d670dab417e245cbd 100644 --- a/src/cq/test/CMakeLists.txt +++ b/src/cq/test/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) LIST(APPEND CQTEST_SRC ./cqtest.c) diff --git a/src/dnode/CMakeLists.txt b/src/dnode/CMakeLists.txt index a009448c822ca651fd91583277ed92b183f155d2..0ac2f4d6876259d826f62cbd7dc5fa2d30b6553b 100644 --- a/src/dnode/CMakeLists.txt +++ b/src/dnode/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/query/inc) diff --git a/src/kit/CMakeLists.txt b/src/kit/CMakeLists.txt index fdf58d5ae1c21ebd8b2948114d9643d38dccae3e..6bc22e5fc8ddcdae1ebd42e400c1c6707b959fea 100644 --- a/src/kit/CMakeLists.txt +++ b/src/kit/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) ADD_SUBDIRECTORY(shell) diff --git a/src/kit/shell/CMakeLists.txt b/src/kit/shell/CMakeLists.txt index 14cca87c912b48005a6f67cb2eb0a9b456fdaaf8..c3929f77a38a4ba31eb857f2a40e6ff46b6444df 100644 --- a/src/kit/shell/CMakeLists.txt +++ b/src/kit/shell/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc) diff --git a/src/kit/taosdemo/CMakeLists.txt b/src/kit/taosdemo/CMakeLists.txt index 2046857eb5e9ec87d37c2bac500ab761f6901772..2007be991af3b98fea3930a874e4efb9b6b1997a 100644 --- a/src/kit/taosdemo/CMakeLists.txt +++ b/src/kit/taosdemo/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc) diff --git a/src/kit/taosdump/CMakeLists.txt b/src/kit/taosdump/CMakeLists.txt index 18075a58134eb86cd75f0bbe0bb37a1d46b09b7c..5b48374e8f7d54bef4d199ff9398aaf6a74b257e 100644 --- a/src/kit/taosdump/CMakeLists.txt +++ b/src/kit/taosdump/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc) diff --git a/src/kit/taospack/CMakeLists.txt b/src/kit/taospack/CMakeLists.txt index 58c36887329f0deb6839162dd966c96d09edbc0f..0549c221ab8b34535ff0209fe925b7479a0100f8 100644 --- a/src/kit/taospack/CMakeLists.txt +++ b/src/kit/taospack/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0) PROJECT(TDengine) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/util/inc) diff --git a/src/mnode/CMakeLists.txt b/src/mnode/CMakeLists.txt index a7fc54d87786f430f913980f089d29d969b01fce..dc2afbbb68de5a9466306721cc966a6f6c8cbd12 100644 --- a/src/mnode/CMakeLists.txt +++ b/src/mnode/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/query/inc) diff --git a/src/os/CMakeLists.txt b/src/os/CMakeLists.txt index a64c9d79dd6af511448ad0f9b186f6e50d59c728..ce009940d11402b5fa4fffcb73ec2958758bf845 100644 --- a/src/os/CMakeLists.txt +++ b/src/os/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) IF (TD_LINUX) diff --git a/src/os/src/darwin/CMakeLists.txt b/src/os/src/darwin/CMakeLists.txt index ed75cac03da112348ff153005d5330786f6386ac..8a495847d21e16cbd765ddb8b77f32120216b0d5 100644 --- a/src/os/src/darwin/CMakeLists.txt +++ b/src/os/src/darwin/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) AUX_SOURCE_DIRECTORY(. SRC) diff --git a/src/os/src/detail/CMakeLists.txt b/src/os/src/detail/CMakeLists.txt index ac68cf4cd8cbd217da8aa2d4a41a5aa159562868..2d537d95885a5e2d86e18ff19e1851fc8eea5997 100644 --- a/src/os/src/detail/CMakeLists.txt +++ b/src/os/src/detail/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) INCLUDE_DIRECTORIES(.) diff --git a/src/os/src/linux/CMakeLists.txt b/src/os/src/linux/CMakeLists.txt index f60c10b65a004735e4b76f5d170a65afc6508c36..612ac8d5ab44ea3d2a33686f3df83646a4f1e268 100644 --- a/src/os/src/linux/CMakeLists.txt +++ b/src/os/src/linux/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) AUX_SOURCE_DIRECTORY(. SRC) diff --git a/src/os/src/windows/CMakeLists.txt b/src/os/src/windows/CMakeLists.txt index 83012d6e3e5a2e11655f4a1c0742cdd25cccddf2..bca76465f3a78408f39db1bcda7810ddd059b8e5 100644 --- a/src/os/src/windows/CMakeLists.txt +++ b/src/os/src/windows/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) AUX_SOURCE_DIRECTORY(. SRC) diff --git a/src/os/tests/CMakeLists.txt b/src/os/tests/CMakeLists.txt index 9ec5076b7201b2d5ed9b2b6eb682eea7d6a83827..ef2c387e079b5b592c162b8533308c3dfd7ca07b 100644 --- a/src/os/tests/CMakeLists.txt +++ b/src/os/tests/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) FIND_PATH(HEADER_GTEST_INCLUDE_DIR gtest.h /usr/include/gtest /usr/local/include/gtest) diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index 3f7157691dbb082f863764352be60bd3a616a02d..83e54b97965f9dd0f8c1b484979cfd2e8919dbb1 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) if(NOT WIN32) @@ -31,7 +31,24 @@ IF (TD_BUILD_HTTP) ELSE () MESSAGE("") MESSAGE("${Green} use blm3 as httpd ${ColourReset}") - MESSAGE("") + EXECUTE_PROCESS( + COMMAND cd blm3 + ) + EXECUTE_PROCESS( + COMMAND git rev-parse --short HEAD + RESULT_VARIABLE commit_sha1 + OUTPUT_VARIABLE blm3_commit_sha1 + ) + IF ("${blm3_commit_sha1}" STREQUAL "") + SET(blm3_commit_sha1 "unknown") + ELSE () + STRING(SUBSTRING "${blm3_commit_sha1}" 0 7 blm3_commit_sha1) + STRING(STRIP "${blm3_commit_sha1}" blm3_commit_sha1) + ENDIF () + MESSAGE("${Green} blm3 commit: ${blm3_commit_sha1} ${ColourReset}") + EXECUTE_PROCESS( + COMMAND cd .. + ) include(ExternalProject) ExternalProject_Add(blm3 PREFIX "blm3" @@ -40,7 +57,7 @@ ELSE () DEPENDS taos BUILD_IN_SOURCE 1 CONFIGURE_COMMAND cmake -E echo "blm3 no need cmake to config" - BUILD_COMMAND CGO_CFLAGS=-I${CMAKE_CURRENT_SOURCE_DIR}/../inc CGO_LDFLAGS=-L${CMAKE_BINARY_DIR}/build/lib go build + BUILD_COMMAND CGO_CFLAGS=-I${CMAKE_CURRENT_SOURCE_DIR}/../inc CGO_LDFLAGS=-L${CMAKE_BINARY_DIR}/build/lib go build -ldflags "-s -w -X github.com/taosdata/blm3/version.CommitID=${blm3_commit_sha1}" INSTALL_COMMAND cmake -E copy blm3 ${CMAKE_BINARY_DIR}/build/bin COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/test/cfg/ COMMAND cmake -E copy ./example/config/blm.toml ${CMAKE_BINARY_DIR}/test/cfg/ ) ENDIF () diff --git a/src/plugins/blm3 b/src/plugins/blm3 index e84009701e4d63b4e57e412dc9e3da7459b12b9f..4bfae86dcabea0d5a40ff81a72be7c822737269b 160000 --- a/src/plugins/blm3 +++ b/src/plugins/blm3 @@ -1 +1 @@ -Subproject commit e84009701e4d63b4e57e412dc9e3da7459b12b9f +Subproject commit 4bfae86dcabea0d5a40ff81a72be7c822737269b diff --git a/src/plugins/http/CMakeLists.txt b/src/plugins/http/CMakeLists.txt index 89fdc141b66adafb9f882dd6f59eca54053aff6c..f372bc66aa6bf9845845ca6eb961d4817383538e 100644 --- a/src/plugins/http/CMakeLists.txt +++ b/src/plugins/http/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/zlib-1.2.11/inc) diff --git a/src/plugins/monitor/CMakeLists.txt b/src/plugins/monitor/CMakeLists.txt index 8a05d63e141facfe34e740887384fec0337534d4..c5768aae19d7644122fb638014e0cd55f4998bb0 100644 --- a/src/plugins/monitor/CMakeLists.txt +++ b/src/plugins/monitor/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) INCLUDE_DIRECTORIES(inc) diff --git a/src/plugins/mqtt/CMakeLists.txt b/src/plugins/mqtt/CMakeLists.txt index 081512138505ab7e7a54a8bbe770aa293adec0be..90d91e8bcbcb0cd26ba0a472469aed48b6049e39 100644 --- a/src/plugins/mqtt/CMakeLists.txt +++ b/src/plugins/mqtt/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) INCLUDE_DIRECTORIES(inc) diff --git a/src/query/CMakeLists.txt b/src/query/CMakeLists.txt index fd730adee56c3d5edddb943303f5b6b24d9f019c..4b57843708ac8d1c24c69e68fe406b0edbeeabd2 100644 --- a/src/query/CMakeLists.txt +++ b/src/query/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/tsdb/inc) diff --git a/src/query/tests/CMakeLists.txt b/src/query/tests/CMakeLists.txt index 949d8f5d4af7e9a27eda84a15108f3e80eb635c2..6f3268377cd816bdc9f8e3bedf5eb0484519840a 100644 --- a/src/query/tests/CMakeLists.txt +++ b/src/query/tests/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) FIND_PATH(HEADER_GTEST_INCLUDE_DIR gtest.h /usr/include/gtest /usr/local/include/gtest) diff --git a/src/rpc/CMakeLists.txt b/src/rpc/CMakeLists.txt index 14b77356baa4b87a201e6ff10e785db99cbd47a6..77d4c82487d109e9e3f203cafa00ab42a51e4613 100644 --- a/src/rpc/CMakeLists.txt +++ b/src/rpc/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) INCLUDE_DIRECTORIES(inc) diff --git a/src/rpc/test/CMakeLists.txt b/src/rpc/test/CMakeLists.txt index a32ac9943d08fe00427ec58520809b4f04657315..91ff29b101b2d213508057ab014a6634a2e45d1f 100644 --- a/src/rpc/test/CMakeLists.txt +++ b/src/rpc/test/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/rpc/inc) diff --git a/src/sync/CMakeLists.txt b/src/sync/CMakeLists.txt index 2cd84c7c3fff63a702d99d8b2dc45303f17528ef..f6f59bf61478bfd6382854b438ba4abef63d710d 100644 --- a/src/sync/CMakeLists.txt +++ b/src/sync/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) INCLUDE_DIRECTORIES(inc) diff --git a/src/sync/test/CMakeLists.txt b/src/sync/test/CMakeLists.txt index a5ab8191371ce97ecbaf9ef4dc8dbace6a6c4802..ef2ac87e3fe25b4118ca573e9ae18482665a5841 100644 --- a/src/sync/test/CMakeLists.txt +++ b/src/sync/test/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) IF (TD_LINUX) diff --git a/src/tfs/CMakeLists.txt b/src/tfs/CMakeLists.txt index 7f956f07a21ed52363fc2072b01ad0853621712b..cece9994ca649870fb36a1ce7f82c0b5f4d45828 100644 --- a/src/tfs/CMakeLists.txt +++ b/src/tfs/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) INCLUDE_DIRECTORIES(inc) diff --git a/src/tsdb/CMakeLists.txt b/src/tsdb/CMakeLists.txt index efbed6f0a6e8218c3a0b46d2913f6a792bf48ce4..0f472cfbfc443e57e538068d28cb3c2c8d228dec 100644 --- a/src/tsdb/CMakeLists.txt +++ b/src/tsdb/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) INCLUDE_DIRECTORIES(inc) diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt index ef304d2fcbcb3a823e2c8253ca578de551499151..eff248661b160ff67a926ec6e9287844a9932a6b 100644 --- a/src/util/CMakeLists.txt +++ b/src/util/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/rpc/inc) diff --git a/src/util/tests/CMakeLists.txt b/src/util/tests/CMakeLists.txt index a60c6cff2809dcc2a55f5cce3e593ef06045a975..583edf1e1926f53bfc896cd0df3f60b928e0bf25 100644 --- a/src/util/tests/CMakeLists.txt +++ b/src/util/tests/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) FIND_PATH(HEADER_GTEST_INCLUDE_DIR gtest.h /usr/include/gtest /usr/local/include/gtest) diff --git a/src/vnode/CMakeLists.txt b/src/vnode/CMakeLists.txt index 6238f43d32ad2ed973f522aca3bb5dfca9101435..0b48ea4f496bfa9fdf9f06af5e599ffc85e520d4 100644 --- a/src/vnode/CMakeLists.txt +++ b/src/vnode/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/cJson/inc) diff --git a/src/wal/CMakeLists.txt b/src/wal/CMakeLists.txt index 0d9be42bd5d54ddd1fdd372511e4f98fb7d6355b..7187581a9daf018dd1363c867c48119564d56355 100644 --- a/src/wal/CMakeLists.txt +++ b/src/wal/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) ADD_DEFINITIONS(-DWAL_CHECKSUM_WHOLE) diff --git a/src/wal/test/CMakeLists.txt b/src/wal/test/CMakeLists.txt index c5bc4198f10d48caf2ea133c475ea99c8e7a2fd2..e3e7ed13d03b44f48ca405856f9466564b45f11d 100644 --- a/src/wal/test/CMakeLists.txt +++ b/src/wal/test/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) IF (TD_LINUX) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 00569342ec0540d2a7c79d577374d8a1569e0bb9..ddeb11eb24cbeefb733bd8bac47f557d3c252f3e 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -3,7 +3,7 @@ # generate release version: # mkdir release; cd release; cmake -DCMAKE_BUILD_TYPE=Release .. -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) SET(CMAKE_C_STANDARD 11) diff --git a/tests/comparisonTest/tdengine/CMakeLists.txt b/tests/comparisonTest/tdengine/CMakeLists.txt index 0f389c4c0cefd10fe829d86342bc391cffe37901..499080b3c6d0b04163211bcf2c752d9b6fff8d13 100644 --- a/tests/comparisonTest/tdengine/CMakeLists.txt +++ b/tests/comparisonTest/tdengine/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) IF (TD_LINUX) diff --git a/tests/test/c/CMakeLists.txt b/tests/test/c/CMakeLists.txt index 2702d192d3f47022f05888f90ca89c4ef533fe44..7053142fdfd4578970144fd757dad74584e9176a 100644 --- a/tests/test/c/CMakeLists.txt +++ b/tests/test/c/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20) PROJECT(TDengine) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc)