mysql-shell for GreatSQL 8.0.27编译安装及使用
2022/3/28 19:23:10
本文主要是介绍mysql-shell for GreatSQL 8.0.27编译安装及使用,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
- GreatSQL社区原创内容未经授权不得随意使用,转载请联系小编并注明来源。
用MySQL Shell要重新拉起一个MGR集群时,可能会提示下面的错误信息:
Dba.rebootClusterFromCompleteOutage: Unable to get an InnoDB cluster handle. The instance '172.16.130.197:3306' may belong to a different cluster from the one registered in the Metadata since the value of 'group_replication_group_name' does not match the one registered in the Metadata: possible split-brain scenario. Please retry while connected to another member of the cluster. (RuntimeError)
意思是该节点属于其他MGR集群(从元数据读取到的 group_replication_group_name
值判断的),因此不能直接拉起。
这种错误常见于MySQL 5.7版本构建的MGR集群环境下,如果是运行MySQL 8.0的话则一般很少见。
之所以会这样,是因为MySQL 5.7中还不支持 SET PERSIST 功能。
在MySQL 8.0中,用MySQL Shell构建MGR集群时,会随机生成一个UUID作为 group_replication_group_name,并以 SET PERSIST 的方式持久化(保存到 mysqld-auto.cnf
文件中),实例重启时还能继续读取。
而在MySQL 5.7中,因为没有这个功能,实例重启时还会从原来的 my.cnf
中读取旧的 group_replication_group_name 值,导致被判断为该节点属于另一个集群。
现在已经知道问题的原因了,解决办法也简单。
- 获取正确的 group_replication_group_name。
实例重启完成后,读取mysql_innodb_cluster_metadata.clusters
这个元数据表,获取正确的 group name。
mysql> select attributes->'$.group_replication_group_name' from clusters; +----------------------------------------------+ | attributes->'$.group_replication_group_name' | +----------------------------------------------+ | "bc664a9b-9b5b-11ec-8a73-525400c5601a" | +----------------------------------------------+
- 在每个节点上手动修改 group_replication_group_name 。
mysql> set global group_replication_group_name = "bc664a9b...";
- 再次执行
dba.rebootClusterFromCompleteOutage()
就行了。
MySQL 172.16.130.197:3306 ssl JS > dba.rebootClusterFromCompleteOutage() Restoring the default cluster from complete outage...
Enjoy GreatSQL
这篇关于mysql-shell for GreatSQL 8.0.27编译安装及使用的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-04-26MySQL查出时间比实际晚8小时的解决方案
- 2024-04-01JPA不识别MySQL的枚举类型
- 2024-03-30mysql数据库表卡死解决方法
- 2024-03-15MySQL多数据源笔记5-ShardingJDBC实战
- 2024-03-11natural join mysql
- 2024-03-11关于VS2017,VS2015 中利用 EF使用Mysql 不显示数据源问题解决方案
- 2024-02-26mysql 阿里云xb后缀备份文件恢复-icode9专业技术文章分享
- 2024-02-22docker mysql 5.7
- 2024-02-18从 20 多套 MySQL 到 1 套 TiDB丨骏伯网络综合运营管理平台应用实践
- 2024-02-07mysql 外键索引入门介绍,为什么工作中很少有人使用?