mysql_innodb_cluster_metadata源数据库

目录

集群总体信息

clusters

clustersets

schema_version

实例(节点)清单

instances

v2_instances

[GR 集群/视图](#GR 集群/视图)

v2_clusters

v2_ar_clusters

async_cluster_members

[Router 相关](#Router 相关)

routers

v2_routers

router_rest_accounts

v2_router_rest_accounts

v2_this_instance

[ClusterSet 扩展(v2 专用)](#ClusterSet 扩展(v2 专用))

v2_cs_clustersets

v2_cs_members

v2_cs_router_option

提示


mysql_innodb_cluster_metadataMySQL Shell / InnoDB Cluster / ClusterSet 的"系统目录库 "。它里面每一张表都记录了 拓扑、状态、实例、路由器、版本号 等关键信息,千万不要手工改动,否则集群会直接报错或无法启动。


集群总体信息

|------------------|-----------------------------------------------|-----------------------------------------------|
| 表名 | 关键字段 | 作用 |
| clusters | cluster_id, cluster_name, topology_mode | 当前 InnoDB Cluster 的名称、模式(单主/多主) |
| clustersets | clusterset_id, clusterset_name | 当启用 ClusterSet(跨地域容灾)时,记录全局 ClusterSet 信息 |
| schema_version | major, minor, patch | 元数据 版本号,升级 Shell 或 MySQL 时会自动变更 |

clusters

clustersets

schema_version


实例(节点)清单

|----------------|-----------------------------------------------------------|-----------------------------------------|
| 表名 | 关键字段 | 作用 |
| instances | mysql_server_uuid, hostname, port, role, weight | 老版本(v1)的节点清单,记录每个 MySQL 实例的地址、角色、权重 |
| v2_instances | instance_id, addresses, attributes, version_token | 新版本 (v2)的节点信息,字段更丰富,支持 IPV6、多地址 |

日常用 select * from v2_instances\G 就能快速看出 哪个节点没上线

instances

v2_instances


GR 集群/视图

|-------------------------|------------------------------------------------------------|-------------------------------------|
| 表名 | 关键字段 | 作用 |
| v2_gr_clusters | cluster_id, group_name, group_seeds, member_weight | 与 Group Replication 参数一一对应,自动同步 |
| v2_ar_clusters | cluster_id, topology | 异步复制集群(ReplicaSet/DR 场景)的元数据 |
| async_cluster_members | member_id, member_role, member_host, member_port | 异步集群的成员信息 |

v2_clusters

v2_ar_clusters

async_cluster_members


Router 相关

|----------------------------------------------------|-----------------------------------------------------|----------------------------------|
| 表名 | 关键字段 | 作用 |
| routers / v2_routers | router_id, hostname, last_check_in, version | MySQL Router 的心跳、版本、最后一次上报时间 |
| router_rest_accounts / v2_router_rest_accounts | account, password | Router 连接元数据库用的 REST API 账号 |
| v2_this_instance | instance_id, cluster_id | Router 本机属于哪个实例、哪个集群(快速定位) |

routers

v2_routers

router_rest_accounts

v2_router_rest_accounts

v2_this_instance


ClusterSet 扩展(v2 专用)

|------------------------|--------------------------------------------------------|------------------------------------------|
| 表名 | 关键字段 | 作用 |
| v2_cs_clustersets | clusterset_id, primary_cluster, failover_counter | 整个 ClusterSet 的 主集群故障切换次数 |
| v2_cs_members | member_cluster_id, member_role | 每个集群在 ClusterSet 里的角色(PRIMARY / REPLICA) |
| v2_cs_router_options | option_name, option_value | Router 对 ClusterSet 的 路由策略(读写分离权重等) |

v2_cs_clustersets

v2_cs_members

v2_cs_router_options

提示

  • 只读表 :任何 UPDATE/DELETE 都会导致 Shell 报错 Metadata inconsistency
  • 升级 ShellMySQL 时会自动 ALTER 这些表,无需手工干预。
相关推荐
倔强的石头_7 小时前
kingbase备份与恢复实战(二)—— sys_dump库级逻辑备份与恢复(Windows详细步骤)
数据库
jiayou642 天前
KingbaseES 实战:深度解析数据库对象访问权限管理
数据库
于眠牧北2 天前
MySQL的锁类型,表锁,行锁,MVCC中所使用的临键锁
mysql
李广坤2 天前
MySQL 大表字段变更实践(改名 + 改类型 + 改长度)
数据库
Turnip12023 天前
深度解析:为什么简单的数据库"写操作"会在 MySQL 中卡住?
后端·mysql
爱可生开源社区3 天前
2026 年,优秀的 DBA 需要具备哪些素质?
数据库·人工智能·dba
随逸1774 天前
《从零搭建NestJS项目》
数据库·typescript
加号34 天前
windows系统下mysql多源数据库同步部署
数据库·windows·mysql
シ風箏4 天前
MySQL【部署 04】Docker部署 MySQL8.0.32 版本(网盘镜像及启动命令分享)
数据库·mysql·docker
李慕婉学姐4 天前
Springboot智慧社区系统设计与开发6n99s526(程序+源码+数据库+调试部署+开发环境)带论文文档1万字以上,文末可获取,系统界面在最后面。
数据库·spring boot·后端