提交 e4fe1320 编写于 作者: S shenglian zhou

Merge branch 'develop' of github.com:taosdata/TDengine into szhou/feature/support-math-functions

--- ---
kind: pipeline 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 name: test_arm64_bionic
platform: platform:
...@@ -37,7 +10,10 @@ steps: ...@@ -37,7 +10,10 @@ steps:
image: arm64v8/ubuntu:bionic image: arm64v8/ubuntu:bionic
commands: commands:
- apt-get update - 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 - git submodule update --init --recursive
- mkdir debug - mkdir debug
- cd debug - cd debug
...@@ -65,7 +41,10 @@ steps: ...@@ -65,7 +41,10 @@ steps:
commands: commands:
- echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections - echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
- apt-get update - 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 - git submodule update --init --recursive
- mkdir debug - mkdir debug
- cd debug - cd debug
...@@ -91,11 +70,17 @@ steps: ...@@ -91,11 +70,17 @@ steps:
- name: build - name: build
image: arm64v8/centos:7 image: arm64v8/centos:7
commands: commands:
- yum install -y gcc gcc-c++ make cmake git - yum install -y epel-release
- 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 - git submodule update --init --recursive
- mkdir debug - mkdir debug
- cd debug - cd debug
- cmake .. -DCPUTYPE=aarch64 > /dev/null - cmake3 .. -DCPUTYPE=aarch64 > /dev/null
- make -j4 - make -j4
trigger: trigger:
event: event:
...@@ -117,7 +102,7 @@ steps: ...@@ -117,7 +102,7 @@ steps:
- name: build - name: build
image: arm64v8/centos:8 image: arm64v8/centos:8
commands: 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 - git submodule update --init --recursive
- mkdir debug - mkdir debug
- cd debug - cd debug
...@@ -144,7 +129,7 @@ steps: ...@@ -144,7 +129,7 @@ steps:
image: arm32v7/ubuntu:bionic image: arm32v7/ubuntu:bionic
commands: commands:
- apt-get update - 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 - git submodule update --init --recursive
- mkdir debug - mkdir debug
- cd debug - cd debug
...@@ -171,7 +156,10 @@ steps: ...@@ -171,7 +156,10 @@ steps:
image: ubuntu:trusty image: ubuntu:trusty
commands: commands:
- apt-get update - 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 - git submodule update --init --recursive
- mkdir debug - mkdir debug
- cd debug - cd debug
...@@ -198,7 +186,10 @@ steps: ...@@ -198,7 +186,10 @@ steps:
image: ubuntu:xenial image: ubuntu:xenial
commands: commands:
- apt-get update - 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 - git submodule update --init --recursive
- mkdir debug - mkdir debug
- cd debug - cd debug
...@@ -224,7 +215,10 @@ steps: ...@@ -224,7 +215,10 @@ steps:
image: ubuntu:bionic image: ubuntu:bionic
commands: commands:
- apt-get update - 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 - git submodule update --init --recursive
- mkdir debug - mkdir debug
- cd debug - cd debug
...@@ -249,11 +243,16 @@ steps: ...@@ -249,11 +243,16 @@ steps:
- name: build - name: build
image: ansible/centos7-ansible image: ansible/centos7-ansible
commands: commands:
- yum install -y gcc gcc-c++ make cmake - yum install -y epel-release
- 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 - git submodule update --init --recursive
- mkdir debug - mkdir debug
- cd debug - cd debug
- cmake .. - cmake3 ..
- make -j4 - make -j4
trigger: trigger:
event: event:
......
...@@ -10,9 +10,9 @@ ELSE () ...@@ -10,9 +10,9 @@ ELSE ()
ENDIF () ENDIF ()
IF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") IF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20)
ELSE () ELSE ()
CMAKE_MINIMUM_REQUIRED(VERSION 2.8) CMAKE_MINIMUM_REQUIRED(VERSION 3.0)
ENDIF () ENDIF ()
SET(TD_ACCOUNT FALSE) SET(TD_ACCOUNT FALSE)
......
import hudson.model.Result import hudson.model.Result
import hudson.model.*; import hudson.model.*;
import jenkins.model.CauseOfInterruption import jenkins.model.CauseOfInterruption
properties([pipelineTriggers([githubPush()])])
node { node {
git url: 'https://github.com/taosdata/TDengine.git'
} }
def skipbuild=0 def skipbuild=0
...@@ -99,7 +97,7 @@ def pre_test(){ ...@@ -99,7 +97,7 @@ def pre_test(){
sh ''' sh '''
cd ${WK} cd ${WK}
git pull >/dev/null git pull >/dev/null
git submodule update --init --recursive
export TZ=Asia/Harbin export TZ=Asia/Harbin
date date
git clean -dfx git clean -dfx
...@@ -149,6 +147,7 @@ def pre_test_win(){ ...@@ -149,6 +147,7 @@ def pre_test_win(){
git fetch origin +refs/pull/%CHANGE_ID%/merge git fetch origin +refs/pull/%CHANGE_ID%/merge
git checkout -qf FETCH_HEAD git checkout -qf FETCH_HEAD
git clean -dfx git clean -dfx
git submodule update --init --recursive
cd C:\\workspace\\TDinternal cd C:\\workspace\\TDinternal
git reset --hard HEAD~10 git reset --hard HEAD~10
''' '''
...@@ -193,6 +192,7 @@ def pre_test_win(){ ...@@ -193,6 +192,7 @@ def pre_test_win(){
} }
pipeline { pipeline {
agent none agent none
options { skipDefaultCheckout() }
environment{ environment{
WK = '/var/lib/jenkins/workspace/TDinternal' WK = '/var/lib/jenkins/workspace/TDinternal'
WKC= '/var/lib/jenkins/workspace/TDinternal/community' WKC= '/var/lib/jenkins/workspace/TDinternal/community'
...@@ -200,7 +200,8 @@ pipeline { ...@@ -200,7 +200,8 @@ pipeline {
stages { stages {
stage('pre_build'){ stage('pre_build'){
agent{label 'master'} agent{label 'master'}
when { options { skipDefaultCheckout() }
when{
changeRequest() changeRequest()
} }
steps { steps {
...@@ -208,59 +209,58 @@ pipeline { ...@@ -208,59 +209,58 @@ pipeline {
abort_previous() abort_previous()
abortPreviousBuilds() abortPreviousBuilds()
} }
sh''' // sh'''
rm -rf ${WORKSPACE}.tes // rm -rf ${WORKSPACE}.tes
cp -r ${WORKSPACE} ${WORKSPACE}.tes // cp -r ${WORKSPACE} ${WORKSPACE}.tes
cd ${WORKSPACE}.tes // cd ${WORKSPACE}.tes
git fetch // git fetch
''' // '''
script { // script {
if (env.CHANGE_TARGET == 'master') { // if (env.CHANGE_TARGET == 'master') {
sh ''' // sh '''
git checkout master // git checkout master
''' // '''
} // }
else if(env.CHANGE_TARGET == '2.0'){ // else if(env.CHANGE_TARGET == '2.0'){
sh ''' // sh '''
git checkout 2.0 // git checkout 2.0
''' // '''
} // }
else{ // else{
sh ''' // sh '''
git checkout develop // git checkout develop
''' // '''
} // }
} // }
sh''' // sh'''
git fetch origin +refs/pull/${CHANGE_ID}/merge // git fetch origin +refs/pull/${CHANGE_ID}/merge
git checkout -qf FETCH_HEAD // git checkout -qf FETCH_HEAD
''' // '''
script{ // script{
skipbuild='2' // skipbuild='2'
skipbuild=sh(script: "git log -2 --pretty=%B | fgrep -ie '[skip ci]' -e '[ci skip]' && echo 1 || echo 2", returnStdout:true) // skipbuild=sh(script: "git log -2 --pretty=%B | fgrep -ie '[skip ci]' -e '[ci skip]' && echo 1 || echo 2", returnStdout:true)
println skipbuild // println skipbuild
} // }
sh''' // sh'''
rm -rf ${WORKSPACE}.tes // rm -rf ${WORKSPACE}.tes
''' // '''
// }
} }
} }
stage('Parallel test stage') { stage('Parallel test stage') {
//only build pr //only build pr
options { skipDefaultCheckout() }
when { when {
allOf{ allOf{
changeRequest() changeRequest()
expression{ not{ expression { env.CHANGE_BRANCH =~ /docs\// }}
return skipbuild.trim() == '2'
}
} }
} }
parallel { parallel {
stage('python_1_s1') { stage('python_1_s1') {
agent{label " slave1 || slave11 "} agent{label " slave1 || slave11 "}
steps { steps {
pre_test() pre_test()
timeout(time: 55, unit: 'MINUTES'){ timeout(time: 55, unit: 'MINUTES'){
sh ''' sh '''
...@@ -421,11 +421,12 @@ pipeline { ...@@ -421,11 +421,12 @@ pipeline {
./test-all.sh b4fq ./test-all.sh b4fq
cd ${WKC}/tests cd ${WKC}/tests
./test-all.sh p4 ./test-all.sh p4
cd ${WKC}/tests '''
./test-all.sh full jdbc // cd ${WKC}/tests
cd ${WKC}/tests // ./test-all.sh full jdbc
./test-all.sh full unit // cd ${WKC}/tests
date''' // ./test-all.sh full unit
} }
} }
} }
...@@ -469,35 +470,35 @@ pipeline { ...@@ -469,35 +470,35 @@ pipeline {
} }
} }
stage('build'){ // stage('build'){
agent{label " wintest "} // agent{label " wintest "}
steps { // steps {
pre_test() // pre_test()
script{ // script{
while(win_stop == 0){ // while(win_stop == 0){
sleep(1) // sleep(1)
} // }
} // }
} // }
} // }
stage('test'){ // stage('test'){
agent{label "win"} // agent{label "win"}
steps{ // steps{
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { // catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
pre_test_win() // pre_test_win()
timeout(time: 20, unit: 'MINUTES'){ // timeout(time: 20, unit: 'MINUTES'){
bat''' // bat'''
cd C:\\workspace\\TDinternal\\community\\tests\\pytest // cd C:\\workspace\\TDinternal\\community\\tests\\pytest
.\\test-all.bat Wintest // .\\test-all.bat Wintest
''' // '''
} // }
} // }
script{ // script{
win_stop=1 // win_stop=1
} // }
} // }
} // }
} }
......
...@@ -32,7 +32,7 @@ For user manual, system design and architecture, engineering blogs, refer to [TD ...@@ -32,7 +32,7 @@ For user manual, system design and architecture, engineering blogs, refer to [TD
# Building # 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. 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 ## Install tools
...@@ -60,7 +60,10 @@ sudo apt-get install -y maven ...@@ -60,7 +60,10 @@ sudo apt-get install -y maven
### Centos 7: ### Centos 7:
```bash ```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: To install openjdk-8:
...@@ -126,6 +129,17 @@ mkdir debug && cd debug ...@@ -126,6 +129,17 @@ mkdir debug && cd debug
cmake .. && cmake --build . cmake .. && cmake --build .
``` ```
Note TDengine 2.3.0.0 and later use a component named 'blm3' to play http daemon role by default instead of the http daemon embedded in the early version of TDengine. The blm3 is programmed by go language. If you pull TDengine source code to the latest from an existing codebase, please execute 'git submodule update --init --recursive' to pull blm3 source code. Please install go language 1.14 or above for compiling blm3. If you meet difficulties regarding 'go mod', especially you are from China, you can use a proxy to solve the problem.
```
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct
```
Or you can use the following command to choose to embed old httpd too.
```
cmake .. -DBUILD_HTTP=true
```
You can use Jemalloc as memory allocator instead of glibc: You can use Jemalloc as memory allocator instead of glibc:
``` ```
apt install autoconf apt install autoconf
......
...@@ -124,17 +124,25 @@ IF (TD_APLHINE) ...@@ -124,17 +124,25 @@ IF (TD_APLHINE)
MESSAGE(STATUS "aplhine is defined") MESSAGE(STATUS "aplhine is defined")
ENDIF () ENDIF ()
IF (TD_LINUX) MESSAGE("before BUILD_HTTP: " ${BUILD_HTTP})
IF ("${BUILD_HTTP}" STREQUAL "")
IF (TD_LINUX)
IF (TD_ARM_32) IF (TD_ARM_32)
SET(TD_BUILD_HTTP TRUE) SET(BUILD_HTTP "true")
ADD_DEFINITIONS(-DHTTP_EMBEDDED)
ELSE () ELSE ()
IF (TD_BUILD_HTTP) SET(BUILD_HTTP "false")
ADD_DEFINITIONS(-DHTTP_EMBEDDED)
ENDIF () ENDIF ()
ELSE ()
SET(BUILD_HTTP "true")
ENDIF () ENDIF ()
ELSE () ENDIF ()
MESSAGE("after BUILD_HTTP: " ${BUILD_HTTP})
IF (${BUILD_HTTP} MATCHES "true")
SET(TD_BUILD_HTTP TRUE) SET(TD_BUILD_HTTP TRUE)
ENDIF ()
IF (TD_BUILD_HTTP)
ADD_DEFINITIONS(-DHTTP_EMBEDDED) ADD_DEFINITIONS(-DHTTP_EMBEDDED)
ENDIF () ENDIF ()
......
...@@ -92,10 +92,6 @@ ENDIF () ...@@ -92,10 +92,6 @@ ENDIF ()
SET(TD_BUILD_HTTP FALSE) SET(TD_BUILD_HTTP FALSE)
IF (${BUILD_HTTP} MATCHES "true")
SET(TD_BUILD_HTTP TRUE)
ENDIF ()
SET(TD_MEMORY_SANITIZER FALSE) SET(TD_MEMORY_SANITIZER FALSE)
IF (${MEMORY_SANITIZER} MATCHES "true") IF (${MEMORY_SANITIZER} MATCHES "true")
SET(TD_MEMORY_SANITIZER TRUE) SET(TD_MEMORY_SANITIZER TRUE)
......
...@@ -4,7 +4,7 @@ PROJECT(TDengine) ...@@ -4,7 +4,7 @@ PROJECT(TDengine)
IF (DEFINED VERNUMBER) IF (DEFINED VERNUMBER)
SET(TD_VER_NUMBER ${VERNUMBER}) SET(TD_VER_NUMBER ${VERNUMBER})
ELSE () ELSE ()
SET(TD_VER_NUMBER "2.2.0.5") SET(TD_VER_NUMBER "2.3.0.0")
ENDIF () ENDIF ()
IF (DEFINED VERCOMPATIBLE) IF (DEFINED VERCOMPATIBLE)
......
PROJECT(TDengine) PROJECT(TDengine)
IF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") IF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20)
ELSE () ELSE ()
CMAKE_MINIMUM_REQUIRED(VERSION 2.8) CMAKE_MINIMUM_REQUIRED(VERSION 3.0)
ENDIF () ENDIF ()
ADD_SUBDIRECTORY(zlib-1.2.11) ADD_SUBDIRECTORY(zlib-1.2.11)
......
CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20)
# MQTT-C build options # MQTT-C build options
option(MQTT_C_OpenSSL_SUPPORT "Build MQTT-C with OpenSSL support?" OFF) option(MQTT_C_OpenSSL_SUPPORT "Build MQTT-C with OpenSSL support?" OFF)
......
PROJECT(TDengine) PROJECT(TDengine)
IF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") IF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20)
ELSE () ELSE ()
CMAKE_MINIMUM_REQUIRED(VERSION 2.8) CMAKE_MINIMUM_REQUIRED(VERSION 3.0)
ENDIF () ENDIF ()
IF (TD_WINDOWS) IF (TD_WINDOWS)
......
CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20)
PROJECT(TDengine) PROJECT(TDengine)
IF (TD_WINDOWS) IF (TD_WINDOWS)
......
此差异已折叠。
此差异已折叠。
CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20)
PROJECT(TDengine) PROJECT(TDengine)
IF (TD_WINDOWS) IF (TD_WINDOWS)
......
CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20)
PROJECT(TDengine) PROJECT(TDengine)
IF (TD_WINDOWS) IF (TD_WINDOWS)
......
CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20)
PROJECT(TDengine) PROJECT(TDengine)
IF (TD_WINDOWS) IF (TD_WINDOWS)
......
CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20) CMAKE_MINIMUM_REQUIRED(VERSION 3.0...3.20)
PROJECT(TDengine) PROJECT(TDengine)
IF (TD_WINDOWS) IF (TD_WINDOWS)
......
...@@ -53,6 +53,8 @@ TDengine是一个高效的存储、查询、分析时序大数据的平台,专 ...@@ -53,6 +53,8 @@ TDengine是一个高效的存储、查询、分析时序大数据的平台,专
* [Schemaless 写入](/insert#schemaless):免于预先建表,将数据直接写入时自动维护元数据结构 * [Schemaless 写入](/insert#schemaless):免于预先建表,将数据直接写入时自动维护元数据结构
* [Prometheus 写入](/insert#prometheus):配置Prometheus, 不用任何代码,将数据直接写入 * [Prometheus 写入](/insert#prometheus):配置Prometheus, 不用任何代码,将数据直接写入
* [Telegraf 写入](/insert#telegraf):配置Telegraf, 不用任何代码,将采集数据直接写入 * [Telegraf 写入](/insert#telegraf):配置Telegraf, 不用任何代码,将采集数据直接写入
* [collectd 直接写入](/insert#collectd):配置 collectd,不用任何代码,将采集数据直接写入
* [StatsD 直接写入](/insert#statsd):配置 StatsD,不用任何代码,将采集数据直接写入
* [EMQ X Broker](/insert#emq):配置EMQ X,不用任何代码,就可将MQTT数据直接写入 * [EMQ X Broker](/insert#emq):配置EMQ X,不用任何代码,就可将MQTT数据直接写入
* [HiveMQ Broker](/insert#hivemq):配置HiveMQ,不用任何代码,就可将MQTT数据直接写入 * [HiveMQ Broker](/insert#hivemq):配置HiveMQ,不用任何代码,就可将MQTT数据直接写入
...@@ -129,7 +131,7 @@ TDengine是一个高效的存储、查询、分析时序大数据的平台,专 ...@@ -129,7 +131,7 @@ TDengine是一个高效的存储、查询、分析时序大数据的平台,专
* [TDengine写入性能测试工具](https://www.taosdata.com/blog/2020/01/18/1166.html) * [TDengine写入性能测试工具](https://www.taosdata.com/blog/2020/01/18/1166.html)
* [IDEA数据库管理工具可视化使用TDengine](https://www.taosdata.com/blog/2020/08/27/1767.html) * [IDEA数据库管理工具可视化使用TDengine](https://www.taosdata.com/blog/2020/08/27/1767.html)
* [基于Electron开发的跨平台TDengine图形化管理工具](https://github.com/skye0207/TDengineGUI) * [基于Electron开发的跨平台TDengine图形化管理工具](https://github.com/skye0207/TDengineGUI)
* [DataX,支持TDengine的离线数据采集/同步工具](https://github.com/wgzhao/DataX)(文档:[读取插件](https://github.com/wgzhao/DataX/blob/master/docs/src/main/sphinx/reader/tdenginereader.md)[写入插件](https://github.com/wgzhao/DataX/blob/master/docs/src/main/sphinx/writer/tdenginewriter.md) * [基于DataX的TDeninge数据迁移工具](https://www.taosdata.com/blog/2021/10/26/3156.html)
## TDengine与其他数据库的对比测试 ## TDengine与其他数据库的对比测试
......
# 高效写入数据 # 高效写入数据
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等接口。数据可以单条插入,也可以批量插入,可以插入一个数据采集点的数据,也可以同时插入多个数据采集点的数据。支持多线程插入,支持时间乱序数据插入,也支持历史数据插入。
## <a class="anchor" id="sql"></a>SQL 写入 ## <a class="anchor" id="sql"></a>SQL 写入
...@@ -98,7 +98,7 @@ Schemaless 按照如下原则来处理行数据: ...@@ -98,7 +98,7 @@ Schemaless 按照如下原则来处理行数据:
用户需要从github下载[Bailongma](https://github.com/taosdata/Bailongma)的源码,使用Golang语言编译器编译生成可执行文件。在开始编译前,需要准备好以下条件: 用户需要从github下载[Bailongma](https://github.com/taosdata/Bailongma)的源码,使用Golang语言编译器编译生成可执行文件。在开始编译前,需要准备好以下条件:
- Linux操作系统的服务器 - Linux操作系统的服务器
- 安装好Golang,1.10版本以上 - 安装好Golang,1.14版本以上
- 对应的TDengine版本。因为用到了TDengine的客户端动态链接库,因此需要安装好和服务端相同版本的TDengine程序;比如服务端版本是TDengine 2.0.0, 则在Bailongma所在的Linux服务器(可以与TDengine在同一台服务器,或者不同服务器) - 对应的TDengine版本。因为用到了TDengine的客户端动态链接库,因此需要安装好和服务端相同版本的TDengine程序;比如服务端版本是TDengine 2.0.0, 则在Bailongma所在的Linux服务器(可以与TDengine在同一台服务器,或者不同服务器)
Bailongma项目中有一个文件夹blm_prometheus,存放了prometheus的写入API程序。编译过程如下: Bailongma项目中有一个文件夹blm_prometheus,存放了prometheus的写入API程序。编译过程如下:
...@@ -184,16 +184,18 @@ select * from apiserver_request_latencies_bucket; ...@@ -184,16 +184,18 @@ select * from apiserver_request_latencies_bucket;
``` ```
## <a class="anchor" id="telegraf"></a> Telegraf 直接写入(通过 BLM v3) ## <a class="anchor" id="telegraf"></a> Telegraf 直接写入(通过 BLM v3)
TDengine 新版本(2.3.0.0+)将包含一个 BLM3 独立程序,负责接受其他多种应用的数据写入。 安装 Telegraf 请参考[官方文档](https://portal.influxdata.com/downloads/)
TDengine 新版本(2.3.0.0+)包含一个 BLM3 独立程序,负责接收包括 Telegraf 的多种应用的数据写入。
配置方法,假设 TDengine 使用默认用户名 root 和密码 taosdata。在 /etc/telegraf/telegraf.conf 增加如下文字 配置方法,在 /etc/telegraf/telegraf.conf 增加如下文字,其中 database name 请填写希望在 TDengine 保存 Telegraf 数据的数据库名,TDengine server/cluster host、username和 password 填写 TDengine 实际值
``` ```
[[outputs.http]] [[outputs.http]]
url = "http://<TDengine server/cluster host>:6041/influxdb/v1/write?db=metrics" url = "http://<TDengine server/cluster host>:6041/influxdb/v1/write?db=<database name>"
method = "POST" method = "POST"
timeout = "5s" timeout = "5s"
username = "root" username = "<TDengine's username>"
password = "taosdata" password = "<TDengine's password>"
data_format = "influx" data_format = "influx"
influx_max_line_bytes = 250 influx_max_line_bytes = 250
``` ```
...@@ -207,16 +209,15 @@ sudo systemctl start telegraf ...@@ -207,16 +209,15 @@ sudo systemctl start telegraf
BLM v3 相关配置参数请参考 blm3 --help 命令输出以及相关文档。 BLM v3 相关配置参数请参考 blm3 --help 命令输出以及相关文档。
## <a class="anchor" id="collectd"></a> collectd 直接写入(通过 BLM v3) ## <a class="anchor" id="collectd"></a> collectd 直接写入(通过 BLM v3)
安装 collectd 安装 collectd,请参考[官方文档](https://collectd.org/download.shtml)
```
apt-get install collectd TDengine 新版本(2.3.0.0+)包含一个 BLM3 独立程序,负责接收包括 collectd 的多种应用的数据写入。
```
在 /etc/collectd/collectd.conf 文件中增加如下内容: 在 /etc/collectd/collectd.conf 文件中增加如下内容,其中 host 和 port 请填写 TDengine 和 BLM3 配置的实际值
``` ```
LoadPlugin network LoadPlugin network
<Plugin network> <Plugin network>
Server "192.168.17.180" "25826" Server "<TDengine cluster/server host>" "<port for collectd>"
</Plugin> </Plugin>
``` ```
重启 collectd 重启 collectd
...@@ -229,18 +230,20 @@ BLM v3 相关配置参数请参考 blm3 --help 命令输出以及相关文档。 ...@@ -229,18 +230,20 @@ BLM v3 相关配置参数请参考 blm3 --help 命令输出以及相关文档。
安装 StatsD 安装 StatsD
请参考[官方文档](https://github.com/statsd/statsd) 请参考[官方文档](https://github.com/statsd/statsd)
在 config.js 文件中增加如下内容后启动 StatsD: TDengine 新版本(2.3.0.0+)包含一个 BLM3 独立程序,负责接收包括 StatsD 的多种应用的数据写入。
在 config.js 文件中增加如下内容后启动 StatsD,其中 host 和 port 请填写 TDengine 和 BLM3 配置的实际值:
``` ```
backends 部分添加 "./backends/repeater" backends 部分添加 "./backends/repeater"
repeater 部分添加 { host:'<TDengine server/cluster host>', port: 8126 } repeater 部分添加 { host:'<TDengine server/cluster host>', port: <port for StatsD>}
``` ```
例配置文件: 例配置文件:
``` ```
{ {
port: 8125 port: 8125
, backends: ["./backends/repeater"] , backends: ["./backends/repeater"]
, repeater: [{ host: '127.0.0.1', port: 8126}] , repeater: [{ host: '127.0.0.1', port: 6044}]
} }
``` ```
......
...@@ -183,7 +183,25 @@ TDengine 中时间戳的时区总是由客户端进行处理,而与服务端 ...@@ -183,7 +183,25 @@ TDengine 中时间戳的时区总是由客户端进行处理,而与服务端
| TCP | 6035 | 多节点集群的节点间通讯。 | 随 serverPort 端口变化。 | | TCP | 6035 | 多节点集群的节点间通讯。 | 随 serverPort 端口变化。 |
| TCP | 6040 | 多节点集群的节点间数据同步。 | 随 serverPort 端口变化。 | | TCP | 6040 | 多节点集群的节点间数据同步。 | 随 serverPort 端口变化。 |
| TCP | 6041 | 客户端与服务端之间的 RESTful 通讯。 | 随 serverPort 端口变化。 | | TCP | 6041 | 客户端与服务端之间的 RESTful 通讯。 | 随 serverPort 端口变化。 |
| TCP | 6042 | Arbitrator 的服务端口。 | 因 Arbitrator 启动参数设置变化。 | | TCP | 6042 | Arbitrator 的服务端口。 | 随 Arbitrator 启动参数设置变化。 |
| TCP | 6043 | TaosKeeper 监控服务端口。 | 随 TaosKeeper 启动参数设置变化。 |
| TCP | 6044 | 支持 StatsD 的数据接入端口。 | 随 BLM3 启动参数设置变化(2.3.0.1+以上版本)。 |
| TCP | 6045 | 支持 collectd 数据接入端口。 | 随 BLM3 启动参数设置变化(2.3.0.1+以上版本)。 |
| TCP | 6060 | 企业版内 Monitor 服务的网络端口。 | | | TCP | 6060 | 企业版内 Monitor 服务的网络端口。 | |
| UDP | 6030-6034 | 客户端与服务端之间通讯。 | 随 serverPort 端口变化。 | | UDP | 6030-6034 | 客户端与服务端之间通讯。 | 随 serverPort 端口变化。 |
| UDP | 6035-6039 | 多节点集群的节点间通讯。 | 随 serverPort 端口变化。 | | UDP | 6035-6039 | 多节点集群的节点间通讯。 | 随 serverPort 端口变化。 |
## 20. go 语言编写组件编译失败怎样解决?
新版本 TDengine 2.3.0.0 包含一个使用 go 语言开发的 BLM3 组件,取代之前内置的 httpd ,提供包含原 httpd 功能以及支持多种其他软件(Prometheus、Telegraf、collectd、StatsD等)的数据接入功能。
使用最新 develop 分支代码编译需要先 `git submodule update --init --recursive` 下载 blm3 仓库代码后再编译。
目前编译方式默认自动编译 blm3。go 语言版本要求 1.14 以上,如果发生 go 编译错误,往往是国内访问 go mod 问题,可以通过设置 go 环境变量来解决:
```sh
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct
```
如果希望继续使用之前的内置 httpd,可以关闭 blm3 编译,使用
`cmake .. -DBUILD_HTTP=true` 使用原来内置的 httpd。
...@@ -39,17 +39,18 @@ IT 运维监测数据通常都是对时间特性比较敏感的数据,例如 ...@@ -39,17 +39,18 @@ IT 运维监测数据通常都是对时间特性比较敏感的数据,例如
``` ```
### 修改 /etc/telegraf/telegraf.conf ### 修改 /etc/telegraf/telegraf.conf
假设 TDengine 使用默认用户名 root 和密码 taosdata。增加如下文字 配置方法,在 /etc/telegraf/telegraf.conf 增加如下文字,其中 database name 请填写希望在 TDengine 保存 Telegraf 数据的数据库名,TDengine server/cluster host、username和 password 填写 TDengine 实际值
``` ```
[[outputs.http]] [[outputs.http]]
url = "http://<TDengine server/cluster host>:6041/influxdb/v1/write?db=metrics" url = "http://<TDengine server/cluster host>:6041/influxdb/v1/write?db=<database name>"
method = "POST" method = "POST"
timeout = "5s" timeout = "5s"
username = "root" username = "<TDengine's username>"
password = "taosdata" password = "<TDengine's password>"
data_format = "influx" data_format = "influx"
influx_max_line_bytes = 250 influx_max_line_bytes = 250
``` ```
然后重启 telegraf: 然后重启 telegraf:
``` ```
sudo systemctl start telegraf sudo systemctl start telegraf
......
...@@ -38,26 +38,26 @@ IT 运维监测数据通常都是对时间特性比较敏感的数据,例如 ...@@ -38,26 +38,26 @@ IT 运维监测数据通常都是对时间特性比较敏感的数据,例如
``` ```
### 配置 collectd ### 配置 collectd
在 /etc/collectd/collectd.conf 文件中增加如下内容后启动 collectd 在 /etc/collectd/collectd.conf 文件中增加如下内容,其中 host 和 port 请填写 TDengine 和 BLM3 配置的实际值
``` ```
LoadPlugin network LoadPlugin network
<Plugin network> <Plugin network>
Server "<TDengine server/cluster host>" "25826" Server "<TDengine cluster/server host>" "<port for collectd>"
</Plugin> </Plugin>
sudo systemctl start collectd sudo systemctl start collectd
``` ```
### 配置 StatsD ### 配置 StatsD
在 config.js 文件中增加如下内容后启动 StatsD: 在 config.js 文件中增加如下内容后启动 StatsD,其中 host 和 port 请填写 TDengine 和 BLM3 配置的实际值
``` ```
backends 部分添加 "./backends/repeater" backends 部分添加 "./backends/repeater"
repeater 部分添加 { host:'<TDengine server/cluster host>', port: 8126 } repeater 部分添加 { host:'<TDengine server/cluster host>', port: <port for StatsD>}
``` ```
### 导入 Dashboard ### 导入 Dashboard
使用 Web 浏览器访问 IP:3000 登录 Grafana 界面,系统初始用户名密码为 admin/admin。 使用 Web 浏览器访问运行 Grafana 的服务器的3000端口 host:3000 登录 Grafana 界面,系统初始用户名密码为 admin/admin。
点击左侧齿轮图标并选择 Plugins,应该可以找到 TDengine data source 插件图标。 点击左侧齿轮图标并选择 Plugins,应该可以找到 TDengine data source 插件图标。
#### 导入 collectd 仪表盘 #### 导入 collectd 仪表盘
......
...@@ -301,3 +301,6 @@ keepColumnName 1 ...@@ -301,3 +301,6 @@ keepColumnName 1
# force TCP transmission # force TCP transmission
# rpcForceTcp 0 # rpcForceTcp 0
# unit MB. Flush vnode wal file if walSize > walFlushSize and walSize > cache*0.5*blocks
# walFlushSize 1024
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册