mysql如何管理innodb元数据_mysql8 参考手册--升级InnoDB集群元数据

随着AdminAPI的发展,某些版本可能要求您升级现有集群的元数据,以确保它们与MySQL Shell的较新版本兼容。例如,在8.0.19版中添加InnoDB ReplicaSet意味着元数据架构已升级到2.0版。无论您是否计划使用InnoDB ReplicaSet,对于使用MySQL Shell 8.0.19或更高版本以及使用MySQL Shell早期版本部署的群集,都必须升级群集的元数据。

警告

如果不升级元数据,则无法使用MySQL Shell 8.0.19更改使用较早版本创建的集群的配置。例如,您可以只针对集群如执行读操作 Cluster.status(), Cluster.describe()和 Cluster.options()。

此dba.upgradeMetadata()操作将MySQL Shell当前连接到的群集上找到的元数据模式的版本与此MySQL Shell版本支持的元数据模式的版本进行比较。如果安装的元数据版本较低,则开始升级过程。dba.upgradeMetadata()然后,该操作会将所有自动创建的MySQL Router用户升级为具有正确的权限。手动创建的名称不是以开头的MySQL路由器用户mysqlrouter不会自动升级。这是升级群集的重要步骤,只有这样,MySQL Router应用程序才能升级。要获取有关在集群中注册了哪个MySQL路由器实例需要元数据升级的信息,请发出:

cluster.listRouters({'onlyUpgradeRequired':'true'})

{

"clusterName": "mycluster",

"routers": {

"example.com::": {

"hostname": "example.com",

"lastCheckIn": "2019-11-26 10:10:37",

"roPort": 6447,

"roXPort": 64470,

"rwPort": 6446,

"rwXPort": 64460,

"version": "8.0.18"

}

}

}

警告

使用新元数据的群集不能由早期的MySQL Shell版本管理,例如,一旦升级到8.0.19版,就不能再使用8.0.18或更早的版本来管理该群集。

要升级群集的元数据,请将MySQL Shell的全局会话连接到您的群集,并使用该 dba.upgradeMetadata()操作将群集的元数据升级到新的元数据。例如:

mysql-js> \connect user@example.com:3306

mysql-js> dba.upgradeMetadata()

InnoDB Cluster Metadata Upgrade

The cluster you are connected to is using an outdated metadata schema version

1.0.1 and needs to be upgraded to 2.0.0.

Without doing this upgrade, no AdminAPI calls except read only operations will

be allowed.

The grants for the MySQL Router accounts that were created automatically when

bootstrapping need to be updated to match the new metadata version's

requirements.

Updating router accounts...

NOTE: 2 router accounts have been updated.

Upgrading metadata at 'example.com:3306' from version 1.0.1 to version 2.0.0.

Creating backup of the metadata schema...

Step 1 of 1: upgrading from 1.0.1 to 2.0.0...

Removing metadata backup...

Upgrade process successfully finished, metadata schema is now on version 2.0.0

如果遇到与群集管理用户缺少特权有关的错误,请使用Cluster.setupAdminAccount() 带有update选项的 操作为用户授予正确的特权。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值