提交 0800eea1 编写于 作者: sangshuduo's avatar sangshuduo

Merge branch '2.6' into feat/sangshuduo/TD-14141-update-taostools-for2.6

......@@ -3,4 +3,4 @@ sidebar_label: HiveMQ Broker
title: HiveMQ Broker writing
---
[HiveMQ](https://www.hivemq.com/) is an MQTT broker that provides community and enterprise editions. HiveMQ is mainly for enterprise emerging machine-to-machine M2M communication and internal transport, meeting scalability, ease of management, and security features. HiveMQ provides an open-source plug-in development kit. MQTT data can be saved to TDengine via TDengine extension for HiveMQ. Please refer to the [HiveMQ extension - TDengine documentation](https://github.com/huskar-t/hivemq-tdengine-extension/blob/b62a26ecc164a310104df57691691b237e091c89/README_EN.md) for details on how to use it.
\ No newline at end of file
[HiveMQ](https://www.hivemq.com/) is an MQTT broker that provides community and enterprise editions. HiveMQ is mainly for enterprise emerging machine-to-machine M2M communication and internal transport, meeting scalability, ease of management, and security features. HiveMQ provides an open-source plug-in development kit. MQTT data can be saved to TDengine via TDengine extension for HiveMQ. Please refer to the [HiveMQ extension - TDengine documentation](https://github.com/taosdata/hivemq-tdengine-extension/blob/master/README_EN.md) for details on how to use it.
......@@ -3,4 +3,4 @@ sidebar_label: HiveMQ Broker
title: HiveMQ Broker 写入
---
[HiveMQ](https://www.hivemq.com/) 是一个提供免费个人版和企业版的 MQTT 代理,主要用于企业和新兴的机器到机器 M2M 通讯和内部传输,满足可伸缩性、易管理和安全特性。HiveMQ 提供了开源的插件开发包。可以通过 HiveMQ extension - TDengine 保存数据到 TDengine。详细使用方法请参考 [HiveMQ extension - TDengine 说明文档](https://github.com/huskar-t/hivemq-tdengine-extension/blob/b62a26ecc164a310104df57691691b237e091c89/README.md)
[HiveMQ](https://www.hivemq.com/) 是一个提供免费个人版和企业版的 MQTT 代理,主要用于企业和新兴的机器到机器 M2M 通讯和内部传输,满足可伸缩性、易管理和安全特性。HiveMQ 提供了开源的插件开发包。可以通过 HiveMQ extension - TDengine 保存数据到 TDengine。详细使用方法请参考 [HiveMQ extension - TDengine 说明文档](https://github.com/taosdata/hivemq-tdengine-extension/blob/master/README.md)
......@@ -239,3 +239,25 @@ taosAdapter 从 TDengine 2.4.0.0 版本开始成为 TDengine 服务端软件的
OOM 是操作系统的保护机制,当操作系统内存(包括 SWAP )不足时,会杀掉某些进程,从而保证操作系统的稳定运行。通常内存不足主要是如下两个原因导致,一是剩余内存小于 vm.min_free_kbytes ;二是程序请求的内存大于剩余内存。还有一种情况是内存充足但程序占用了特殊的内存地址,也会触发 OOM 。
TDengine 会预先为每个 VNode 分配好内存,每个 Database 的 VNode 个数受 maxVgroupsPerDb 影响,每个 VNode 占用的内存大小受 Blocks 和 Cache 影响。要防止 OOM,需要在项目建设之初合理规划内存,并合理设置 SWAP ,除此之外查询过量的数据也有可能导致内存暴涨,这取决于具体的查询语句。TDengine 企业版对内存管理做了优化,采用了新的内存分配器,对稳定性有更高要求的用户可以考虑选择企业版。
### 26. 为何批量写入数据时,时间戳使用 NOW 函数拼接会导致数据丢失?
首先需要强调一个概念,TDengine 作为一个时序数据库(Time-Series Database),首个时间戳字段起到主键的作用,内存索引的构建、磁盘数据的存储与其密切相关,不能有重复的时间戳。
NOW 函数(以及 NOW 关键字)返回客户端当前时间。当执行批量写入时,若首列时间戳给的值都是 NOW,在数据库默认毫秒的时间级别下是区分不开的(建库时可选择更高的时间精度),后续写入的重复时间戳将会丢失或更新,处理重复时间戳的具体逻辑由在 TDengine 中建库时的 Update 参数决定。
### 27. 扩容集群后,DNode 状态为 Offline 怎么办?
新的节点正常加入集群后,数据节点列表中会显示该节点处于 Ready 状态。若该节点状态为 Offline,可按照如下内容进行排查:
1. 查看该节点 taosd 是否已启动、防火墙是否关闭;
2. 确认新增节点的数据文件夹是否清空;
3. 检查所有节点 /etc/hosts 域名解析是否完整、有效(需要有所有节点的解析,包括 arbitrator);
4. 该节点 firstEP、fqdn 参数是否正确配置。
### 28. 能提供 TDengine 的建模实例吗?
在社区支持的过程中,能发现很多新手小伙伴在部署 TDengine 后不知道如何进一步体验,我们的建议是跑一跑官网文档的语句。文档内容较多,为了方便新手小伙伴快速上手,我们将官网文档的示例模型浓缩、汇总了一下,希望尽可能快的让大家了解 TDengine 建模方法:[建模入门](https://github.com/taosdata/tdengine-modeling-and-querying-101/blob/main/cases/001-electricity-meter-monitoring.zh-hans.md)
同时也欢迎社区的用户们为仓库 [tdengine-modeling-and-querying-101](https://github.com/taosdata/tdengine-modeling-and-querying-101) 提交 PR,展现 TDengine 在各行各业的建模实例。
......@@ -814,6 +814,8 @@
3,,pytest,python3 test.py -f table/columnNameValidation.py
3,,pytest,python3 test.py -f table/tagNameCaseSensitive.py
3,,pytest,python3 test.py -f table/tbNameCaseSensitive.py
3,,pytest,python3 test.py -f functions/function_max_row.py
3,,pytest,python3 test.py -f functions/function_min_row.py
3,,develop-test,python3 ./test.py -f 2-query/ts_hidden_column.py
3,,develop-test,python3 ./test.py -f 2-query/ts_shortcut.py
3,,develop-test,python3 ./test.py -f 2-query/nchar_funcs.py
......
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import sys
import taos
from util.log import *
from util.cases import *
from util.sql import *
import numpy as np
class TDTestCase:
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor())
self.rowNum = 10
self.tables = 10
self.ts = 1537146000000
def run(self):
tdSql.prepare()
intData = []
floatData = []
tdSql.execute("create table stb (ts timestamp, c1 int, c2 double, c3 float) tags(t1 int)")
for i in range(self.tables):
tdSql.execute("create table tb%d using stb tags(%d)" % (i, i))
sql = "insert into tb%d values" % i
for j in range(self.rowNum):
sql += "(%d, %d, %f, %f)" % (self.ts + j * 3000, j, j + 0.1, j + 0.1)
intData.append(j)
floatData.append(j + 0.1)
tdSql.execute(sql)
tdSql.error("select max_row(ts) from stb")
tdSql.error("select max_row(t1) from stb")
tdSql.query("select max_row(c1) from stb")
tdSql.checkData(0, 0, np.max(intData))
tdSql.query("select max_row(c1), * from stb")
tdSql.checkData(0, 0, np.max(intData))
tdSql.checkData(0, 2, np.max(intData))
tdSql.checkData(0, 3, np.max(floatData))
tdSql.checkData(0, 4, np.max(floatData))
tdSql.query("select max_row(c1), * from stb group by tbname")
for i in range(self.tables):
tdSql.checkData(i, 0, np.max(intData))
tdSql.checkData(i, 2, np.max(intData))
tdSql.checkData(i, 3, np.max(floatData))
tdSql.checkData(i, 4, np.max(floatData))
tdSql.query("select max_row(c1), * from stb interval(6s)")
tdSql.checkRows(5)
tdSql.query("select max_row(c1), * from tb1 interval(6s)")
tdSql.checkRows(5)
tdSql.query("select max_row(c1), * from stb interval(6s) group by tbname")
tdSql.checkRows(50)
tdSql.query("select max_row(c1), * from (select min_row(c1) c1, * from stb group by tbname)")
tdSql.checkData(0, 0, np.min(intData))
tdSql.checkRows(1)
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())
\ No newline at end of file
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import sys
import taos
from util.log import *
from util.cases import *
from util.sql import *
import numpy as np
class TDTestCase:
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor())
self.rowNum = 10
self.tables = 10
self.ts = 1537146000000
def run(self):
tdSql.prepare()
intData = []
floatData = []
tdSql.execute("create table stb (ts timestamp, c1 int, c2 double, c3 float) tags(t1 int)")
for i in range(self.tables):
tdSql.execute("create table tb%d using stb tags(%d)" % (i, i))
sql = "insert into tb%d values" % i
for j in range(self.rowNum):
sql += "(%d, %d, %f, %f)" % (self.ts + j * 3000, j, j + 0.1, j + 0.1)
intData.append(j)
floatData.append(j + 0.1)
tdSql.execute(sql)
tdSql.error("select min_row(ts) from stb")
tdSql.error("select min_row(t1) from stb")
tdSql.query("select min_row(c1) from stb")
tdSql.checkData(0, 0, np.min(intData))
tdSql.query("select min_row(c1), * from stb")
tdSql.checkData(0, 0, np.min(intData))
tdSql.checkData(0, 2, np.min(intData))
tdSql.checkData(0, 3, np.min(floatData))
tdSql.checkData(0, 4, np.min(floatData))
tdSql.query("select min_row(c1), * from stb group by tbname")
for i in range(self.tables):
tdSql.checkData(i, 0, np.min(intData))
tdSql.checkData(i, 2, np.min(intData))
tdSql.checkData(i, 3, np.min(floatData))
tdSql.checkData(i, 4, np.min(floatData))
tdSql.query("select min_row(c1), * from stb interval(6s)")
tdSql.checkRows(5)
tdSql.query("select min_row(c1), * from tb1 interval(6s)")
tdSql.checkRows(5)
tdSql.query("select min_row(c1), * from stb interval(6s) group by tbname")
tdSql.checkRows(50)
tdSql.query("select min_row(c1), * from (select max_row(c1) c1, * from stb group by tbname)")
tdSql.checkData(0, 0, np.max(intData))
tdSql.checkRows(1)
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())
\ No newline at end of file
......@@ -68,6 +68,16 @@ class TDTestCase:
# TD-6006
tdSql.error("select * from dev_001 where 'name' is not null")
tdSql.error("select * from dev_001 where \"name\" = 'first'")
# TS-1577
tdSql.query("show databases")
rows = tdSql.queryRows
for i in range(1000):
tdSql.execute("create database test%d" % i)
tdSql.query("show databases")
tdSql.checkRows(rows + 1000)
def stop(self):
tdSql.close()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册