Skip to content

管理

本文件介绍了在 GreptimeDB 系统运维和部署中使用的策略和实践。

数据库/集群管理

运行时信息

例如查询一张表的所有 Region Id:

sql
SELECT greptime_partition_id FROM PARTITIONS WHERE table_name = 'monitor'
SELECT greptime_partition_id FROM PARTITIONS WHERE table_name = 'monitor'

查询一张表的 region 分布在哪些 datanode 上:

sql
SELECT b.peer_id as datanode_id,
       a.greptime_partition_id as region_id
FROM information_schema.partitions a LEFT JOIN information_schema.region_peers b
ON a.greptime_partition_id = b.region_id
WHERE a.table_name='monitor'
ORDER BY datanode_id ASC
SELECT b.peer_id as datanode_id,
       a.greptime_partition_id as region_id
FROM information_schema.partitions a LEFT JOIN information_schema.region_peers b
ON a.greptime_partition_id = b.region_id
WHERE a.table_name='monitor'
ORDER BY datanode_id ASC

INFORMATION_SCHEMA 数据库提供了对系统元数据的访问,如数据库或表的名称、列的数据类型等。请阅读 参考文档

数据管理

最佳实践

TODO