提交 56c22c5c 编写于 作者: C Cary Xu

Merge branch 'develop' into hotfix/TS-774-D

......@@ -41,68 +41,54 @@ def pre_test(){
killall -9 taosd ||echo "no taosd running"
killall -9 gdb || echo "no gdb running"
killall -9 python3.8 || echo "no python program running"
cd ${WKC}
git reset --hard HEAD~10 >/dev/null
cd ${WS}
rm -rf ${WK}
'''
script {
if (env.CHANGE_TARGET == 'master') {
sh '''
cd ${WKC}
git checkout master
cd ${WS}
cd TDinternal_master
git pull
cd community
git pull
cd ${WS}
cp -fr TDinternal_master TDinternal
'''
}
else if(env.CHANGE_TARGET == '2.0'){
sh '''
cd ${WKC}
git checkout 2.0
cd ${WS}
cd TDinternal_2.0
git pull
cd community
git pull
cd ${WS}
cp -fr TDinternal_2.0 TDinternal
'''
}
else{
sh '''
cd ${WKC}
git checkout develop
cd ${WS}
cd TDinternal_develop
git pull
cd community
git pull
cd ${WS}
cp -fr TDinternal_develop TDinternal
'''
}
}
sh'''
cd ${WKC}
[ -f src/connector/grafanaplugin/README.md ] && rm -f src/connector/grafanaplugin/README.md > /dev/null || echo "failed to remove grafanaplugin README.md"
git pull >/dev/null
git fetch origin +refs/pull/${CHANGE_ID}/merge
git checkout -qf FETCH_HEAD
git clean -dfx
git ls-files --stage | grep 160000 | awk '{print $4}' | xargs git rm --cached
git submodule update --init --recursive
cd ${WK}
git reset --hard HEAD~10
'''
script {
if (env.CHANGE_TARGET == 'master') {
sh '''
cd ${WK}
git checkout master
'''
}
else if(env.CHANGE_TARGET == '2.0'){
sh '''
cd ${WK}
git checkout 2.0
'''
}
else{
sh '''
cd ${WK}
git checkout develop
'''
}
}
sh '''
cd ${WK}
git pull >/dev/null
cd ${WK}
export TZ=Asia/Harbin
date
git clean -dfx
mkdir debug
cd debug
cmake .. > /dev/null
......@@ -116,143 +102,117 @@ def pre_test(){
def pre_test_noinstall(){
sh'hostname'
sh'''
cd ${WKC}
git reset --hard HEAD~10 >/dev/null
cd ${WS}
rm -rf ${WK}
'''
script {
if (env.CHANGE_TARGET == 'master') {
sh '''
cd ${WKC}
git checkout master
cd ${WS}
cd TDinternal_master
git pull
cd community
git pull
cd ${WS}
cp -fr TDinternal_master TDinternal
'''
}
else if(env.CHANGE_TARGET == '2.0'){
sh '''
cd ${WKC}
git checkout 2.0
cd ${WS}
cd TDinternal_20
git pull
cd community
git pull
cd ${WS}
cp -fr TDinternal_20 TDinternal
'''
}
else{
sh '''
cd ${WKC}
git checkout develop
cd ${WS}
cd TDinternal_develop
git pull
cd community
git pull
cd ${WS}
cp -fr TDinternal_develop TDinternal
'''
}
}
sh'''
cd ${WKC}
[ -f src/connector/grafanaplugin/README.md ] && rm -f src/connector/grafanaplugin/README.md > /dev/null || echo "failed to remove grafanaplugin README.md"
git pull >/dev/null
git fetch origin +refs/pull/${CHANGE_ID}/merge
git checkout -qf FETCH_HEAD
git clean -dfx
git ls-files --stage | grep 160000 | awk '{print $4}' | xargs git rm --cached
git submodule update --init --recursive
cd ${WK}
git reset --hard HEAD~10
'''
script {
if (env.CHANGE_TARGET == 'master') {
sh '''
cd ${WK}
git checkout master
'''
}
else if(env.CHANGE_TARGET == '2.0'){
sh '''
cd ${WK}
git checkout 2.0
'''
}
else{
sh '''
cd ${WK}
git checkout develop
'''
}
}
sh '''
cd ${WK}
git pull >/dev/null
cd ${WK}
export TZ=Asia/Harbin
date
git clean -dfx
mkdir debug
cd debug
cmake .. > /dev/null
make
make
'''
return 1
}
def pre_test_mac(){
sh'hostname'
sh'''
cd ${WKC}
git reset --hard HEAD~10 >/dev/null
cd ${WS}
rm -rf ${WK}
'''
script {
if (env.CHANGE_TARGET == 'master') {
sh '''
cd ${WKC}
git checkout master
cd ${WS}
cd TDinternal_master
git pull
cd community
git pull
cd ${WS}
cp -fr TDinternal_master TDinternal
'''
}
else if(env.CHANGE_TARGET == '2.0'){
sh '''
cd ${WKC}
git checkout 2.0
cd ${WS}
cd TDinternal_20
git pull
cd community
git pull
cd ${WS}
cp -fr TDinternal_20 TDinternal
'''
}
else{
sh '''
cd ${WKC}
git checkout develop
cd ${WS}
cd TDinternal_develop
git pull
cd community
git pull
cd ${WS}
cp -fr TDinternal_develop TDinternal
'''
}
}
sh'''
cd ${WKC}
[ -f src/connector/grafanaplugin/README.md ] && rm -f src/connector/grafanaplugin/README.md > /dev/null || echo "failed to remove grafanaplugin README.md"
git pull >/dev/null
git fetch origin +refs/pull/${CHANGE_ID}/merge
git checkout -qf FETCH_HEAD
git clean -dfx
git ls-files --stage | grep 160000 | awk '{print $4}' | xargs git rm --cached
git submodule update --init --recursive
cd ${WK}
git reset --hard HEAD~10
'''
script {
if (env.CHANGE_TARGET == 'master') {
sh '''
cd ${WK}
git checkout master
'''
}
else if(env.CHANGE_TARGET == '2.0'){
sh '''
cd ${WK}
git checkout 2.0
'''
}
else{
sh '''
cd ${WK}
git checkout develop
'''
}
}
sh '''
cd ${WK}
git pull >/dev/null
cd ${WK}
export TZ=Asia/Harbin
date
git clean -dfx
mkdir debug
cd debug
cmake .. > /dev/null
go env -w GOPROXY=https://goproxy.cn,direct
go env -w GO111MODULE=on
cmake --build .
'''
return 1
......@@ -262,67 +222,47 @@ def pre_test_win(){
taskkill /f /t /im python.exe
cd C:\\
rd /s /Q C:\\TDengine
cd C:\\workspace\\TDinternal
rd /s /Q C:\\workspace\\TDinternal\\debug
cd C:\\workspace\\TDinternal\\community
git reset --hard HEAD~10
cd C:\\workspace
rd /s /Q C:\\workspace\\TDinternal | echo 1
'''
script {
if (env.CHANGE_TARGET == 'master') {
bat '''
cd C:\\workspace\\TDinternal\\community
git checkout master
cd C:\\workspace\\TDinternal_master
git pull
cd C:\\workspace\\TDinternal_master\\community
git pull
xcopy /e/y/i/f C:\\workspace\\TDinternal_master C:\\workspace\\TDinternal
'''
}
else if(env.CHANGE_TARGET == '2.0'){
bat '''
cd C:\\workspace\\TDinternal\\community
git checkout 2.0
cd C:\\workspace\\TDinternal_20
git pull
cd C:\\workspace\\TDinternal_20\\community
git pull
xcopy /e/y/i/f C:\\workspace\\TDinternal_20 C:\\workspace\\TDinternal
'''
}
else{
bat '''
cd C:\\workspace\\TDinternal\\community
git checkout develop
cd C:\\workspace\\TDinternal_develop
git pull
cd C:\\workspace\\TDinternal_develop\\community
git pull
xcopy /e/y/i/f C:\\workspace\\TDinternal_develop C:\\workspace\\TDinternal
'''
}
}
bat'''
cd C:\\workspace\\TDinternal\\community
git pull
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
'''
script {
if (env.CHANGE_TARGET == 'master') {
bat '''
cd C:\\workspace\\TDinternal
git checkout master
'''
}
else if(env.CHANGE_TARGET == '2.0'){
bat '''
cd C:\\workspace\\TDinternal
git checkout 2.0
'''
}
else{
bat '''
cd C:\\workspace\\TDinternal
git checkout develop
'''
}
}
bat '''
cd C:\\workspace\\TDinternal
git pull
date
git clean -dfx
mkdir debug
cd debug
call "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build\\vcvarsall.bat" amd64
......@@ -342,6 +282,7 @@ pipeline {
environment{
WK = '/var/lib/jenkins/workspace/TDinternal'
WKC= '/var/lib/jenkins/workspace/TDinternal/community'
WS = '/var/lib/jenkins/workspace'
}
stages {
stage('pre_build'){
......
......@@ -64,7 +64,7 @@ To build the [taos-tools](https://github.com/taosdata/taos-tools) on Ubuntu/Debi
sudo apt install libjansson-dev libsnappy-dev liblzma-dev libz-dev pkg-config
```
### Centos 7:
### CentOS 7:
```bash
sudo yum install epel-release
sudo yum update
......@@ -82,7 +82,7 @@ To install Apache Maven:
sudo yum install -y maven
```
### Centos 8 & Fedora:
### CentOS 8 & Fedora:
```bash
sudo dnf install -y gcc gcc-c++ make cmake epel-release git
```
......@@ -100,8 +100,9 @@ sudo dnf install -y maven
#### Install build dependencies for taos-tools
To build the [taos-tools](https://github.com/taosdata/taos-tools) on CentOS, the following packages need to be installed.
```bash
sudo yum install xz-devel snappy-devel jansson-devel pkgconfig libatomic
sudo yum install libz-devel xz-devel snappy-devel jansson-devel pkgconfig libatomic
```
Note: Since snappy lacks pkg-config support (refer to [link](https://github.com/google/snappy/pull/86)), it lead a cmake prompt libsnappy not found. But snappy will works well.
### Setup golang environment
TDengine includes few components developed by Go language. Please refer to golang.org official documentation for golang environment setup.
......
......@@ -83,6 +83,10 @@ TDengine是一个高效的存储、查询、分析时序大数据的平台,专
* [Windows客户端](https://www.taosdata.com/blog/2019/07/26/514.html):自行编译windows客户端,Windows环境的各种连接器都需要它
* [Rust Connector](/connector/rust): Rust语言下通过libtaos客户端或RESTful接口,连接TDengine服务器。
## [TDengine 组件与工具](/tools/adapter)
* [taosAdapter用户手册](/tools/adapter)
## [与其他工具的连接](/connections)
* [Grafana](/connections#grafana):获取并可视化保存在TDengine的数据
......
......@@ -1052,7 +1052,7 @@ HTTP 请求 URL 采用 `sqlutc` 时,返回结果集的时间戳将采用 UTC
示例程序源码位于
* {client_install_directory}/examples/C#
* [github C# example source code](https://github.com/taosdata/TDengine/tree/develop/tests/examples/C%23)
* [github C# example source code](https://github.com/taosdata/TDengine/tree/develop/tests/examples/C\%23)
**注意:** TDengineTest.cs C#示例源程序,包含了数据库连接参数,以及如何执行数据插入、查询等操作。
......@@ -1084,7 +1084,7 @@ dotnet add package TDengine.Connector
```c#
using TDengineDriver;
```
* 用户可以参考[TDengineTest.cs](https://github.com/taosdata/TDengine/tree/develop/tests/examples/C%23/TDengineTest)来定义数据库连接参数,以及如何执行数据插入、查询等操作。
* 用户可以参考[TDengineTest.cs](https://github.com/taosdata/TDengine/tree/develop/tests/examples/C\%23/TDengineTest)来定义数据库连接参数,以及如何执行数据插入、查询等操作。
**注意:**
......
......@@ -25,8 +25,8 @@ IT 运维监测数据通常都是对时间特性比较敏感的数据,例如
### Grafana
请参考[官方文档](https://grafana.com/grafana/download)
### 安装 TDengine
从涛思数据官网[下载](http://taosdata.com/cn/all-downloads/页面下载最新 TDengine-server 2.3.0.0 或以上版本安装。
### TDengine
从涛思数据官网[下载](http://taosdata.com/cn/all-downloads/)页面下载最新 TDengine-server 2.3.0.0 或以上版本安装。
## 数据链路设置
......
......@@ -8,7 +8,7 @@
- 数据写入和查询的性能远超 OpenTSDB;
- 针对时序数据的高效压缩机制,压缩后在磁盘上的存储空间不到 1/5;
- 安装部署非常简单,单一安装包完成安装部署,除了 taosAdapter 需要依赖 Go 运行环境外,不依赖其他的第三方软件,整个安装部署过程秒级搞定;
- 安装部署非常简单,单一安装包完成安装部署,不依赖其他的第三方软件,整个安装部署过程秒级搞定;
- 提供的内建函数覆盖 OpenTSDB 支持的全部查询函数,还支持更多的时序数据查询函数、标量函数及聚合函数,支持多种时间窗口聚合、连接查询、表达式运算、多种分组聚合、用户定义排序、以及用户定义函数等高级查询功能。采用类 SQL 的语法规则,更加简单易学,基本上没有学习成本。
- 支持多达 128 个标签,标签总长度可达到 16 KB;
- 除 HTTP 之外,还提供 Java、Python、C、Rust、Go 等多种语言的接口,支持 JDBC 等多种企业级标准连接器协议。
......@@ -40,7 +40,11 @@
- **调整数据收集器配置**
在 TDengine 2.3 版本中,后台服务 taosd 启动后一个 HTTP 的服务 taosAdapter 也会自动启用*。*利用 taosAdapter 能够兼容 Influxdb 的 Line Protocol 和 OpenTSDB 的 telnet/JSON 写入协议,可以将 collectd 和 StatsD 收集的数据直接推送到TDengine。
在TDengine 2.3版本中,我们发布了taosAdapter ,taosAdapter 是一个无状态、可快速弹性伸缩的组件,它可以兼容 Influxdb 的 Line Protocol 和 OpenTSDB 的 telnet/JSON 写入协议规范,提供了丰富的数据接入能力,有效的节省用户迁移成本,降低用户应用迁移的难度。
用户可以根据需求弹性部署 taosAdapter 实例,结合场景的需要,快速提升数据写入的吞吐量,为不同应用场景下的数据写入提供保障。
通过taosAdapter,用户可以将 collectd 和 StatsD 收集的数据直接推送到TDengine ,实现应用场景的无缝迁移,非常的轻松便捷。taosAdapter还支持Telegraf、Icinga、TCollector 、node_exporter的数据接入,使用详情参考[taosAdapter](https://www.taosdata.com/cn/documentation/tools/adapter)
如果使用 collectd,修改其默认位置 `/etc/collectd/collectd.conf` 的配置文件为指向 taosAdapter 部署的节点 IP 地址和端口。假设 taosAdapter 的 IP 地址为192.168.1.130,端口为 6046,配置如下:
......@@ -61,24 +65,9 @@ LoadPlugin write_tsdb
- **调整看板(Dashborad)系统**
在数据能够正常写入TDengine 后,可以调整适配 Grafana 将写入 TDengine 的数据可视化呈现出来。Grafana 暂时还不能够直接连接 TDengine,在 TDengine 的安装目录下 connector/grafanaplugin 有为 Grafana 提供的连接插件。使用该插件的方式很简单:
首先将grafanaplugin目录下的dist目录整体拷贝到Grafana的插件目录(默认地址为 `/var/lib/grafana/plugins/`),然后重启 Grafana 即可在 **Add Data Source** 菜单下看见 TDengine 数据源。
```shell
sudo cp -r . /var/lib/grafana/plugins/tdengine
sudo chown grafana:grafana -R /var/lib/grafana/plugins/tdengine
echo -e "[plugins]\nallow_loading_unsigned_plugins = taosdata-tdengine-datasource\n" | sudo tee -a /etc/grafana/grafana.ini
# start grafana service
sudo service grafana-server restart
# or with systemd
sudo systemctl start grafana-server
```
在数据能够正常写入TDengine 后,可以调整适配 Grafana 将写入 TDengine 的数据可视化呈现出来。获取和使用TDengine提供的Grafana插件请参考[与其他工具的连接](https://www.taosdata.com/cn/documentation/connections#grafana)
此外,TDengine 还提供了默认的两套Dashboard 模板,供用户快速查看保存到TDengine库里的信息。你只需要将 Grafana 目录下的模板导入到Grafana中即可激活使用。
TDengine 提供了默认的两套Dashboard 模板,用户只需要将 Grafana 目录下的模板导入到Grafana中即可激活使用。
![](../../images/IT-DevOps-Solutions-Immigrate-OpenTSDB-Dashboard.jpg)
......@@ -129,8 +118,8 @@ TDengine 当前只支持 Grafana 的可视化看板呈现,所以如果你的
| 序号 | 测量(metric) | 值名称 | 类型 | tag1 | tag2 | tag3 | tag4 | tag5 |
| ---- | -------------- | ------ | ------ | ---- | ----------- | -------------------- | --------- | ------ |
| 1 | memory | value | double | host | memory_type | memory_type_instance | source | |
| 2 | swap | value | double | host | swap_type | swap_type_instance | source | |
| 1 | memory | value | double | host | memory_type | memory_type_instance | source | n/a |
| 2 | swap | value | double | host | swap_type | swap_type_instance | source | n/a |
| 3 | disk | value | double | host | disk_point | disk_instance | disk_type | source |
......@@ -191,7 +180,21 @@ TDengine支持标准的JDBC 3.0接口操纵数据库,你也可以使用其他
为了方便历史数据的迁移工作,我们为数据同步工具DataX提供了插件,能够将数据自动写入到TDengine中,需要注意的是DataX的自动化数据迁移只能够支持单值模型的数据迁移过程。
DataX 具体的使用方式及如何使用DataX将数据写入TDengine请参见其使用帮助手册 [github.com/taosdata/datax](http://github.com/taosdata/datax)
DataX 具体的使用方式及如何使用DataX将数据写入TDengine请参见[基于DataX的TDeninge数据迁移工具](https://www.taosdata.com/blog/2021/10/26/3156.html)
在对DataX进行迁移实践后,我们发现通过启动多个进程,同时迁移多个metric 的方式,可以大幅度的提高迁移历史数据的效率,下面是迁移过程中的部分记录,希望这些能为应用迁移工作带来参考。
| datax实例个数 (并发进程个数) | 迁移记录速度 (条/秒) |
| ---- | -------------- |
| 1 | 约13.9万 |
| 2 | 约21.8万 |
| 3 | 约24.9万 |
| 5 | 约29.5万 |
| 10 | 约33万 |
<br/>(注:测试数据源自 单节点 Intel(R) Core(TM) i7-10700 CPU@2.90GHz 16核64G硬件设备,channel和batchSize 分别为8和1000,每条记录包含10个tag)
### 2、手动迁移数据
......
......@@ -79,6 +79,10 @@ TDengine is a highly efficient platform to store, query, and analyze time-series
- [Windows Client](https://www.taosdata.com/blog/2019/07/26/514.html): compile your own Windows client, which is required by various connectors on the Windows environment
- [Rust Connector](/connector/rust): A taosc/RESTful API based TDengine client for Rust
## [Components and Tools](/tools/adapter)
* [taosAdapter](/tools/adapter)
## [Connections with Other Tools](/connections)
- [Grafana](/connections#grafana): query the data saved in TDengine and provide visualization
......@@ -128,4 +132,4 @@ TDengine is a highly efficient platform to store, query, and analyze time-series
## FAQ
- [FAQ: Common questions and answers](/faq)
\ No newline at end of file
- [FAQ: Common questions and answers](/faq)
......@@ -855,7 +855,7 @@ Only some configuration parameters related to RESTful interface are listed below
### Example Source Code
you can find sample code under follow directions:
* {client_install_directory}/examples/C#
* [github C# example source code](https://github.com/taosdata/TDengine/tree/develop/tests/examples/C%23)
* [github C# example source code](https://github.com/taosdata/TDengine/tree/develop/tests/examples/C\%23)
**Tips:** TDengineTest.cs One of C# connector's sample code that include basic examples like connection,sql executions and so on.
......@@ -888,7 +888,7 @@ dotnet add package TDengine.Connector
```C#
using TDengineDriver;
```
* user can reference from[TDengineTest.cs](https://github.com/taosdata/TDengine/tree/develop/tests/examples/C%23/TDengineTest) and learn how to define database connection,query,insert and other basic data manipulations.
* user can reference from[TDengineTest.cs](https://github.com/taosdata/TDengine/tree/develop/tests/examples/C\%23/TDengineTest) and learn how to define database connection,query,insert and other basic data manipulations.
**Note:**
......
# Rapidly build an IT DevOps system with TDengine + Telegraf + Grafana
## Background
TDengine is an open-source big data platform designed and optimized for Internet of Things (IoT), Connected Vehicles, and Industrial IoT. Besides the 10x faster time-series database, it provides caching, stream computing, message queuing and other functionalities to reduce the complexity and costs of development and operations.
There are a lot of time-series data in the IT DevOps scenario, for example:
- Metrics of system resource: CPU, memory, IO and network status, etc.
- Metrics for software system: service status, number of connections, number of requests, number of the timeout, number of errors, response time, service type, and other metrics related to the specific business.
A mainstream IT DevOps system generally includes a data-collection module, a data persistent module, and a visualization module. Telegraf and Grafana are some of the most popular data-collection and visualization modules. But data persistent module can be varied. OpenTSDB and InfluxDB are some prominent from others. In recent times, TDengine, as emerged time-series data platform provides more advantages including high performance, high reliability, easier management, easier maintenance.
Here we introduce a way to build an IT DevOps system with TDengine, Telegraf, and Grafana. Even no need one line program code but just modify a few lines of configuration files.
![IT-DevOps-Solutions-Telegraf.png](../../images/IT-DevOps-Solutions-Telegraf.png)
## Installation steps
### Install Telegraf,Grafana and TDengine
Please refer to each component's official document for Telegraf, Grafana, and TDengine installation.
### Telegraf
Please refer to the [official document](https://portal.influxdata.com/downloads/).
### Grafana
Please refer to the [official document](https://grafana.com/grafana/download).
### TDengine
Please download TDengine 2.3.0.0 or the above version from TAOS Data's [official website](http://taosdata.com/en/all-downloads/).
## Setup data chain
### Download TDengine plugin to Grafana plugin's directory
```bash
1. wget -c https://github.com/taosdata/grafanaplugin/releases/download/v3.1.1/tdengine-datasource-3.1.1.zip
2. sudo unzip tdengine-datasource-3.1.1.zip -d /var/lib/grafana/plugins/
3. sudo chown grafana:grafana -R /var/lib/grafana/plugins/tdengine
4. echo -e "[plugins]\nallow_loading_unsigned_plugins = tdengine-datasource\n" | sudo tee -a /etc/grafana/grafana.ini
5. sudo systemctl restart grafana-server.service
```
### Modify /etc/telegraf/telegraf.conf
Please add few lines in /etc/telegraf/telegraf.conf as below. Please fill database name for what you desire to save Telegraf's data in TDengine. Please specify the correct value for the hostname of the TDengine server/cluster, username, and password:
```
[[outputs.http]]
url = "http://<TDengine server/cluster host>:6041/influxdb/v1/write?db=<database name>"
method = "POST"
timeout = "5s"
username = "<TDengine's username>"
password = "<TDengine's password>"
data_format = "influx"
influx_max_line_bytes = 250
```
Then restart telegraf:
```
sudo systemctl start telegraf
```
### Import dashboard
Use your Web browser to access IP:3000 to log in to the Grafana management interface. The default username and password are admin/admin。
Click the 'gear' icon from the left bar to select 'Plugins'. You could find the icon of the TDengine data source plugin.
Click the 'plus' icon from the left bar to select 'Import'. You can download the dashboard JSON file from https://github.com/taosdata/grafanaplugin/blob/master/examples/telegraf/grafana/dashboards/telegraf-dashboard-v0.1.0.json then import it to the Grafana. After that, you should see the interface like:
![IT-DevOps-Solutions-telegraf-dashboard.png](../../images/IT-DevOps-Solutions-telegraf-dashboard.png)
## Summary
We demonstrated how to build a full-function IT DevOps system with TDengine, Telegraf, and Grafana. TDengine supports schemaless protocol data insertion capability from 2.3.0.0. Based on TDengine's powerful ecosystem software integration capability, the user can build a high efficient and easy-to-maintain IT DevOps system in a few minutes. Please find more detailed documentation about TDengine high-performance data insertion/query functions and more use cases from TAOS Data's official website.
# Rapidly build a IT DevOps system with TDengine + collectd/StatsD + Grafana
## Background
TDengine is an open-source big data platform designed and optimized for Internet of Things (IoT), Connected Vehicles, and Industrial IoT. Besides the 10x faster time-series database, it provides caching, stream computing, message queuing and other functionalities to reduce the complexity and costs of development and operations.
There are a lot of time-series data in the IT DevOps scenario, for example:
- Metrics of system resource: CPU, memory, IO and network status, etc.
- Metrics for software system: service status, number of connections, number of requests, number of the timeout, number of errors, response time, service type, and other metrics related to the specific business.
A mainstream IT DevOps system generally includes a data-collection module, a data persistent module, and a visualization module. Telegraf and Grafana are some of the most popular data-collection and visualization modules. But data persistent module can be varied. OpenTSDB and InfluxDB are some prominent from others. In recent times, TDengine, as emerged time-series data platform provides more advantages including high performance, high reliability, easier management, easier maintenance.
Here we introduce a way to build an IT DevOps system with TDengine, collectd/statsD, and Grafana. Even no need one line program code but just modify a few lines of configuration files.
![IT-DevOps-Solutions-Collectd-StatsD.png](../../images/IT-DevOps-Solutions-Collectd-StatsD.png)
## Installation steps
Please refer to each component's official document for collectd, StatsD, Grafana, and TDengine installation.
### collectd
Please refer to the [official document](https://collectd.org/documentation.shtml).
### StatsD
Please refer to the [official document](https://github.com/statsd/statsd).
### Grafana
Please refer to the [official document](https://grafana.com/grafana/download).
### TDengine
Please download TDengine 2.3.0.0 or the above version from TAOS Data's [official website](http://taosdata.com/cn/all-downloads/).
## Setup data chain
### Download TDengine plugin to Grafana plugin's directory
```bash
1. wget -c https://github.com/taosdata/grafanaplugin/releases/download/v3.1.1/tdengine-datasource-3.1.1.zip
2. sudo unzip tdengine-datasource-3.1.1.zip -d /var/lib/grafana/plugins/
3. sudo chown grafana:grafana -R /var/lib/grafana/plugins/tdengine
4. echo -e "[plugins]\nallow_loading_unsigned_plugins = tdengine-datasource\n" | sudo tee -a /etc/grafana/grafana.ini
5. sudo systemctl restart grafana-server.service
```
### To configure collectd
Please add a few lines in /etc/collectd/collectd.conf as below. Please specify the correct value for hostname and the port number:
```
LoadPlugin network
<Plugin network>
Server "<TDengine cluster/server host>" "<port for collectd>"
</Plugin>
sudo systemctl start collectd
```
### To configure StatsD
Please add a few lines in the config.js file then restart StatsD. Please use the correct hostname and port number of TDengine and taosAdapter:
```
fill backends section with "./backends/repeater"
fill repeater section with { host:'<TDengine server/cluster host>', port: <port for StatsD>}
```
### Import dashboard
Use your Web browser to access IP:3000 to log in to the Grafana management interface. The default username and password are admin/admin。
Click the gear icon from the left bar to select 'Plugins'. You could find the icon of the TDengine data source plugin.
#### Import collectd dashboard
Please download the dashboard JSON file from https://github.com/taosdata/grafanaplugin/blob/master/examples/collectd/grafana/dashboards/collect-metrics-with-tdengine-v0.1.0.json.
Click the 'plus' icon from the left bar to select 'Import'. Then you should see the interface like:
![IT-DevOps-Solutions-collectd-dashboard.png](../../images/IT-DevOps-Solutions-collectd-dashboard.png)
#### Import StatsD dashboard
Please download dashboard JSON file from https://github.com/taosdata/grafanaplugin/blob/master/examples/statsd/dashboards/statsd-with-tdengine-v0.1.0.json.
Click the 'plus' icon from the left bar to select 'Import'. Then you should see the interface like:
![IT-DevOps-Solutions-statsd-dashboard.png](../../images/IT-DevOps-Solutions-statsd-dashboard.png)
## Summary
We demonstrated how to build a full-function IT DevOps system with TDengine, collectd, StatsD, and Grafana. TDengine supports schemaless protocol data insertion capability from 2.3.0.0. Based on TDengine's powerful ecosystem software integration capability, the user can build a high efficient and easy-to-maintain IT DevOps system in few minutes. Please find more detailed documentation about TDengine high-performance data insertion/query functions and more use cases from TAOS Data's official website.
此差异已折叠。
......@@ -846,7 +846,7 @@ vercomp () {
function is_version_compatible() {
curr_version=`ls ${script_dir}/driver/libtaos.so* |cut -d '.' -f 3-6`
curr_version=`ls ${script_dir}/driver/libtaos.so* | awk -F 'libtaos.so.' '{print $2}'`
if [ -f ${script_dir}/driver/vercomp.txt ]; then
min_compatible_version=`cat ${script_dir}/driver/vercomp.txt`
......
......@@ -17,7 +17,7 @@
#include "taos.h"
#include "shellCommand.h"
#define SHELL_INPUT_MAX_COMMAND_SIZE 500000
#define SHELL_INPUT_MAX_COMMAND_SIZE 10000
extern char configDir[];
......
......@@ -43,7 +43,7 @@ ELSE ()
COMMAND git clean -f -d
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/taosadapter/version.CommitID=${taosadapter_commit_sha1}"
INSTALL_COMMAND
COMMAND curl -sL https://github.com/upx/upx/releases/download/v3.96/upx-3.96-amd64_linux.tar.xz -o upx.tar.xz && tar xvJf upx.tar.xz --strip-components 1 > /dev/null && ./upx taosadapter || :
COMMAND curl -sL https://github.com/upx/upx/releases/download/v3.96/upx-3.96-amd64_linux.tar.xz -o upx.tar.xz && tar -xvJf upx.tar.xz -C ${CMAKE_BINARY_DIR} --strip-components 1 > /dev/null && ${CMAKE_BINARY_DIR}/upx taosadapter || :
COMMAND cmake -E copy taosadapter ${CMAKE_BINARY_DIR}/build/bin
COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/test/cfg/
COMMAND cmake -E copy ./example/config/taosadapter.toml ${CMAKE_BINARY_DIR}/test/cfg/
......
Subproject commit 6397bf5963f62f0aa5c4b9b961b16ed5c62579f1
Subproject commit 88346a2e4e2e9282d2ec8b8c5264ca1ec23698a1
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册