首批通过分布式安全可靠测评,为关键业务系统打造
如何确认每个租户的 GTS 的 Leader 位置
更新时间:2026-06-12 07:31
OceanBase 数据库中每一个租户都拥有独立的 GTS 服务,GTS 也是一个多副本的高可用架构。本文讲述确认租户的 GTS 的 Leader 位置的方法。
适用版本
OceanBase 数据库 V2.x 和 V3.x 版本。
操作方法
GTS 服务有一个虚拟的 table_id,可以使用以下方法获得其 table_id。假如租户 ID 为 1005。
obclient> select 1005 << 40 | 135; +------------------+ | 1005 << 40 | 135 | +------------------+ | 1105009185915015 | +------------------+在
__all_root_table中查询 GTS 的 Leader 位置。obclient> select * from oceanbase.__all_root_table where table_id=1105009185915015 and role=1;