Tdengine是一款国产高性能时序数据库,以下常用问题排查使用指令。
2.4后,taosadapter拆分,想提供restful功能的6041端口需要安装后重启
systemctl restart taosadapter
show 数据库.vgroups
taos> show test.vgroups;
vgId | tables | status | onlines | v1_dnode | v1_status | compacting |
==========================================================================================
7 | 1000 | ready | 1 | 3 | master | 0 |
8 | 1000 | ready | 1 | 3 | master | 0 |
9 | 1000 | ready | 1 | 1 | master | 0 |
10 | 1000 | ready | 1 | 3 | master | 0 |
11 | 1000 | ready | 1 | 1 | master | 0 |
12 | 1000 | ready | 1 | 3 | master | 0 |
13 | 1000 | ready | 1 | 1 | master | 0 |
14 | 1000 | ready | 1 | 3 | master | 0 |
15 | 1000 | ready | 1 | 1 | master | 0 |
16 | 1000 | ready | 1 | 3 | master | 0 |
Query OK, 10 row(s) in set (0.001870s)
vgId:test库关联的vnode索引; 利用此索引号可查看具体空间占用情况
cd /usr/local/taos/data/vnode # 进入taos数据存储路径
du -sh *
$ du -sh *
83M vnode11
83M vnode13
83M vnode15
83M vnode9
# root in /usr/local/taos/data/vnode [12:39:53]
以上结果表明test库下的vnode9文件块占用83M,某个数据库占用总数需要将库关联的所偶vgId占用相加。
describe 数据库.表;
结果:
taos> describe power.meters;
Field | Type | Length | Note |
=================================================================================
ts | TIMESTAMP | 8 | |
value | FLOAT | 4 | |
code | NCHAR | 64 | TAG |
Query OK, 3 row(s) in set (0.001462s)
taos> show databases\G; #末尾必须加;
结果:
taos> show databases\G;
*************************** 1.row ***************************
name: test
created_time: 2022-02-21 02:36:27.281
ntables: 10000
vgroups: 10
replica: 1
quorum: 1
days: 10
keep: 3650
cache(MB): 16
blocks: 6
minrows: 100
maxrows: 4096
wallevel: 1
fsync: 3000
comp: 2
cachelast: 0
precision: ms
update: 0
status: ready
*************************** 2.row ***************************
taos> show power.stables;
结果:
taos> show power.stables;
name | created_time | columns | tags | tables |
============================================================================================
meters | 2022-02-16 07:00:23.971 | 2 | 1 | 3 |
taos> SHOW DATABASES;
结果:
taos> SHOW DATABASES;
name | created_time | ntables | vgroups | replica | quorum | days | keep | cache(MB) | blocks | minrows | maxrows | wallevel | fsync | comp | cachelast | precision | update | status |
====================================================================================================================================================================================================================================================================================
test | 2022-02-21 02:36:27.281 | 10000 | 10 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ms | 0 | ready |
log | 2022-02-15 09:28:31.300 | 30 | 1 | 1 | 1 | 10 | 30 | 1 | 3 | 100 | 4096 | 1 | 3000 | 2 | 0 | us | 0 | ready |
p4abf3e71 | 2022-02-18 09:34:52.412 | 12 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ms | 0 | ready |
power | 2022-02-16 06:54:33.892 | 3 | 1 | 1 | 1 | 10 | 3650 | 16 | 3 | 100 | 4096 | 1 | 3000 | 2 | 0 | ms | 1 | ready |
Query OK, 4 row(s) in set (0.002136s)