Merge branch 'refact/tsdb_last' of github.com:taosdata/tdengine into refact/tsdb_last
This commit is contained in:
commit
a71b4d2126
|
@ -25,7 +25,7 @@ taosKeeper 安装方式:
|
|||
<!-- taosKeeper 需要在操作系统终端执行,该工具支持两种配置方式:[命令行参数](#命令行参数启动) 和 [配置文件](#配置文件启动)。命令行参数优先级高于配置文件参数。-->
|
||||
taosKeeper 需要在操作系统终端执行,该工具支持 [配置文件启动](#配置文件启动)。
|
||||
|
||||
**在运行 taosKeeper 之前要确保 TDengine 集群与 taosAdapter 已经在正确运行。**
|
||||
**在运行 taosKeeper 之前要确保 TDengine 集群与 taosAdapter 已经在正确运行。** 并且 TDengine 已经开启监控服务,具体请参考:[TDengine 监控配置](../config/#监控相关)。
|
||||
|
||||
<!--
|
||||
### 命令行参数启动
|
||||
|
@ -93,7 +93,7 @@ taosKeeper 作为 TDengine 监控指标的导出工具,可以将 TDengine 产
|
|||
|
||||
```shell
|
||||
$ taos
|
||||
#
|
||||
# 如上示例,使用 log 库作为监控日志存储位置
|
||||
> use log;
|
||||
> select * from cluster_info limit 1;
|
||||
```
|
|
@ -1,4 +0,0 @@
|
|||
---
|
||||
sidebar_label: taosX
|
||||
title: 使用 taosX 在集群间复制数据
|
||||
---
|
|
@ -193,7 +193,7 @@ docker run -d \
|
|||
|
||||
如上图所示,在 Query 中选中 `TDengine` 数据源,在下方查询框可输入相应 SQL 进行查询,具体说明如下:
|
||||
|
||||
- INPUT SQL:输入要查询的语句(该 SQL 语句的结果集应为两列多行),例如:`select avg(mem_system) from log.dn where ts >= $from and ts < $to interval($interval)` ,其中,from、to 和 interval 为 TDengine 插件的内置变量,表示从 Grafana 插件面板获取的查询范围和时间间隔。除了内置变量外,`也支持可以使用自定义模板变量`。
|
||||
- INPUT SQL:输入要查询的语句(该 SQL 语句的结果集应为两列多行),例如:`select _wstart, avg(mem_system) from log.dnodes_info where ts >= $from and ts < $to interval($interval)` ,其中,from、to 和 interval 为 TDengine 插件的内置变量,表示从 Grafana 插件面板获取的查询范围和时间间隔。除了内置变量外,`也支持可以使用自定义模板变量`。
|
||||
- ALIAS BY:可设置当前查询别名。
|
||||
- GENERATE SQL: 点击该按钮会自动替换相应变量,并生成最终执行的语句。
|
||||
|
||||
|
@ -205,7 +205,11 @@ docker run -d \
|
|||
|
||||
### 导入 Dashboard
|
||||
|
||||
在数据源配置页面,您可以为该数据源导入 TDinsight 面板,作为 TDengine 集群的监控可视化工具。该 Dashboard 已发布在 Grafana:[Dashboard 15167 - TDinsight](https://grafana.com/grafana/dashboards/15167)) 。其他安装方式和相关使用说明请见 [TDinsight 用户手册](/reference/tdinsight/)。
|
||||
在数据源配置页面,您可以为该数据源导入 TDinsight 面板,作为 TDengine 集群的监控可视化工具。如果 TDengine 服务端为 3.0 版本请选择 `TDinsight for 3.x` 导入。
|
||||
|
||||

|
||||
|
||||
其中适配 TDengine 2.* 的 Dashboard 已发布在 Grafana:[Dashboard 15167 - TDinsight](https://grafana.com/grafana/dashboards/15167)) 。其他安装方式和相关使用说明请见 [TDinsight 用户手册](/reference/tdinsight/)。
|
||||
|
||||
使用 TDengine 作为数据源的其他面板,可以[在此搜索](https://grafana.com/grafana/dashboards/?dataSource=tdengine-datasource)。以下是一份不完全列表:
|
||||
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 6.3 KiB |
|
@ -38,22 +38,22 @@ typedef struct STagVal STagVal;
|
|||
typedef struct STag STag;
|
||||
|
||||
// bitmap
|
||||
#define N1(n) ((1 << (n)) - 1)
|
||||
#define BIT1_SIZE(n) (((n)-1) / 8 + 1)
|
||||
#define BIT2_SIZE(n) (((n)-1) / 4 + 1)
|
||||
#define SET_BIT1(p, i, v) \
|
||||
do { \
|
||||
(p)[(i) / 8] &= N1((i) % 8); \
|
||||
(p)[(i) / 8] |= (((uint8_t)(v)) << (((i) % 8))); \
|
||||
} while (0)
|
||||
const static uint8_t BIT1_MAP[8][2] = {
|
||||
{0b00000000, 0b00000001}, {0b00000001, 0b00000011}, {0b00000011, 0b00000111}, {0b00000111, 0b00001111},
|
||||
{0b00001111, 0b00011111}, {0b00011111, 0b00111111}, {0b00111111, 0b01111111}, {0b01111111, 0b11111111},
|
||||
};
|
||||
|
||||
#define GET_BIT1(p, i) (((p)[(i) / 8] >> ((i) % 8)) & ((uint8_t)1))
|
||||
#define SET_BIT2(p, i, v) \
|
||||
do { \
|
||||
p[(i) / 4] &= N1((i) % 4 * 2); \
|
||||
(p)[(i) / 4] |= (((uint8_t)(v)) << (((i) % 4) * 2)); \
|
||||
} while (0)
|
||||
#define GET_BIT2(p, i) (((p)[(i) / 4] >> (((i) % 4) * 2)) & ((uint8_t)3))
|
||||
const static uint8_t BIT2_MAP[4][4] = {{0b00000000, 0b00000001, 0b00000010, 0},
|
||||
{0b00000011, 0b00000111, 0b00001011, 2},
|
||||
{0b00001111, 0b00011111, 0b00101111, 4},
|
||||
{0b00111111, 0b01111111, 0b10111111, 6}};
|
||||
|
||||
#define BIT1_SIZE(n) (((n)-1) >> 3 + 1)
|
||||
#define BIT2_SIZE(n) (((n)-1) >> 2 + 1)
|
||||
#define SET_BIT1(p, i, v) ((p)[(i) >> 3] &= BIT1_MAP[(i)&7][v])
|
||||
#define GET_BIT1(p, i) (((p)[(i) >> 3] >> ((i)&7)) & ((uint8_t)1))
|
||||
#define SET_BIT2(p, i, v) ((p)[(i) >> 2] &= BIT2_MAP[(i)&3][v])
|
||||
#define GET_BIT2(p, i) (((p)[(i) >> 2] >> BIT2_MAP[(i)&3][3]) & ((uint8_t)3))
|
||||
|
||||
// STSchema
|
||||
int32_t tTSchemaCreate(int32_t sver, SSchema *pSchema, int32_t nCols, STSchema **ppTSchema);
|
||||
|
@ -171,7 +171,7 @@ struct SColVal {
|
|||
|
||||
#pragma pack(push, 1)
|
||||
struct STagVal {
|
||||
// char colName[TSDB_COL_NAME_LEN]; // only used for tmq_get_meta
|
||||
// char colName[TSDB_COL_NAME_LEN]; // only used for tmq_get_meta
|
||||
union {
|
||||
int16_t cid;
|
||||
char *pKey;
|
||||
|
|
|
@ -180,11 +180,29 @@ int metaDelJsonVarFromIdx(SMeta *pMeta, const SMetaEntry *pCtbEntry, const SSche
|
|||
}
|
||||
|
||||
int metaCreateSTable(SMeta *pMeta, int64_t version, SVCreateStbReq *pReq) {
|
||||
SMetaEntry me = {0};
|
||||
SMetaEntry me = {0};
|
||||
int kLen = 0;
|
||||
int vLen = 0;
|
||||
const void *pKey = NULL;
|
||||
const void *pVal = NULL;
|
||||
void *pBuf = NULL;
|
||||
int32_t szBuf = 0;
|
||||
void *p = NULL;
|
||||
|
||||
// validate req
|
||||
if (tdbTbGet(pMeta->pNameIdx, pReq->name, strlen(pReq->name), NULL, NULL) == 0) {
|
||||
return 0;
|
||||
void *pData = NULL;
|
||||
int nData = 0;
|
||||
if (tdbTbGet(pMeta->pNameIdx, pReq->name, strlen(pReq->name) + 1, &pData, &nData) == 0) {
|
||||
tb_uid_t uid = *(tb_uid_t *)pData;
|
||||
tdbFree(pData);
|
||||
SMetaInfo info;
|
||||
metaGetInfo(pMeta, uid, &info);
|
||||
if (info.uid == info.suid) {
|
||||
return 0;
|
||||
} else {
|
||||
terrno = TSDB_CODE_TDB_TABLE_ALREADY_EXIST;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
// set structs
|
||||
|
|
|
@ -3,6 +3,21 @@ system sh/deploy.sh -n dnode1 -i 1
|
|||
system sh/exec.sh -n dnode1 -s start
|
||||
sql connect
|
||||
|
||||
print =============== conflict stb
|
||||
sql create database db vgroups 1;
|
||||
sql use db;
|
||||
sql create table stb (ts timestamp, i int) tags (j int);
|
||||
sql_error create table stb using stb tags (1);
|
||||
sql_error create table stb (ts timestamp, i int);
|
||||
|
||||
sql create table ctb (ts timestamp, i int);
|
||||
sql_error create table ctb (ts timestamp, i int) tags (j int);
|
||||
|
||||
sql create table ntb (ts timestamp, i int);
|
||||
sql_error create table ntb (ts timestamp, i int) tags (j int);
|
||||
|
||||
sql drop database db
|
||||
|
||||
print =============== create database d1
|
||||
sql create database d1
|
||||
sql use d1
|
||||
|
|
Loading…
Reference in New Issue