如果InnoDB集群元数据被删除,Router连接会发生什么情况

2023年 9月 12日 70.6k 0

​删除InnoDB集群元数据的后果,如下所示:

<code style="text-align: left;"> MySQL 172.26.170.13:3306 ssl Py > dba.drop_metadata_schema()
Are you sure you want to remove the Metadata? [y/N]: y
Metadata Schema successfully removed.

如果删除了InnoDB集群元数据,路由器将无法连接到集群。使用客户端直通路由器对标准R/W流量进行的持续模拟失败,原因如下:

现有的连接会被路由器丢弃。任何通过路由器建立的到集群的新连接也将失败。

Router logs contain:

[root@test_cdh_001 ~]# tail -f /var/log/mysqlrouter/mysqlrouter.log

2023-09-10 21:34:03 metadata_cache WARNING [7fc6e041a700] Failed fetching metadata from metadata server on 172.26.170.13:3306 - Expected MySQL Server '172.26.170.13:3306' to contain the metadata of MySQL InnoDB Cluster, but the schema does not exist.
Checking version of the metadata schema failed with: Error executing MySQL query "SELECT * FROM mysql_innodb_cluster_metadata.schema_version": Unknown database 'mysql_innodb_cluster_metadata' (1049)

See https://dev.mysql.com/doc/mysql-shell/en/deploying-production-innodb-cluster.html for instructions on setting up a MySQL Server to act as an InnoDB Cluster Metadata server

2023-09-10 21:34:03 metadata_cache WARNING [7fc6e041a700] Failed fetching metadata from metadata server on 172.26.170.14:3306 - Expected MySQL Server '172.26.170.14:3306' to contain the metadata of MySQL InnoDB Cluster, but the schema does not exist.
Checking version of the metadata schema failed with: Error executing MySQL query "SELECT * FROM mysql_innodb_cluster_metadata.schema_version": Unknown database 'mysql_innodb_cluster_metadata' (1049)

See https://dev.mysql.com/doc/mysql-shell/en/deploying-production-innodb-cluster.html for instructions on setting up a MySQL Server to act as an InnoDB Cluster Metadata server

2023-09-10 21:34:03 metadata_cache INFO [7fc6e041a700] Connected with metadata server running on 172.26.170.15:3306
2023-09-10 21:34:03 metadata_cache WARNING [7fc6e041a700] Failed fetching metadata from metadata server on 172.26.170.15:3306 - Expected MySQL Server '172.26.170.15:3306' to contain the metadata of MySQL InnoDB Cluster, but the schema does not exist.
Checking version of the metadata schema failed with: Error executing MySQL query "SELECT * FROM mysql_innodb_cluster_metadata.schema_version": Unknown database 'mysql_innodb_cluster_metadata' (1049)

See https://dev.mysql.com/doc/mysql-shell/en/deploying-production-innodb-cluster.html for instructions on setting up a MySQL Server to act as an InnoDB Cluster Metadata server

2023-09-10 21:34:03 metadata_cache ERROR [7fc6e041a700] Failed fetching metadata from any of the 3 metadata servers.
2023-09-10 21:34:03 metadata_cache INFO [7fc6e041a700] ... cleared current routing table as a precaution
2023-09-10 21:34:03 routing INFO [7fc6e041a700] Stop accepting connections for routing routing:bootstrap_x_rw listening on 6448
2023-09-10 21:34:03 routing INFO [7fc6e041a700] Stop accepting connections for routing routing:bootstrap_x_ro listening on 6449
2023-09-10 21:34:03 routing INFO [7fc6e041a700] Stop accepting connections for routing routing:bootstrap_ro listening on 6447
2023-09-10 21:34:03 routing INFO [7fc6e041a700] Stop accepting connections for routing routing:bootstrap_rw listening on 6446
2023-09-10 21:34:04 metadata_cache WARNING [7fc6e041a700] Failed fetching metadata from metadata server on 172.26.170.13:3306 - Expected MySQL Server '172.26.170.13:3306' to contain the metadata of MySQL InnoDB Cluster, but the schema does not exist.
Checking version of the metadata schema failed with: Error executing MySQL query "SELECT * FROM mysql_innodb_cluster_metadata.schema_version": Unknown database 'mysql_innodb_cluster_metadata' (1049)

See https://dev.mysql.com/doc/mysql-shell/en/deploying-production-innodb-cluster.html for instructions on setting up a MySQL Server to act as an InnoDB Cluster Metadata server

2023-09-10 21:34:04 metadata_cache WARNING [7fc6e041a700] Failed fetching metadata from metadata server on 172.26.170.14:3306 - Expected MySQL Server '172.26.170.14:3306' to contain the metadata of MySQL InnoDB Cluster, but the schema does not exist.
Checking version of the metadata schema failed with: Error executing MySQL query "SELECT * FROM mysql_innodb_cluster_metadata.schema_version": Unknown database 'mysql_innodb_cluster_metadata' (1049)

See https://dev.mysql.com/doc/mysql-shell/en/deploying-production-innodb-cluster.html for instructions on setting up a MySQL Server to act as an InnoDB Cluster Metadata server

2023-09-10 21:34:04 metadata_cache WARNING [7fc6e041a700] Failed fetching metadata from metadata server on 172.26.170.15:3306 - Expected MySQL Server '172.26.170.15:3306' to contain the metadata of MySQL InnoDB Cluster, but the schema does not exist.
Checking version of the metadata schema failed with: Error executing MySQL query "SELECT * FROM mysql_innodb_cluster_metadata.schema_version": Unknown database 'mysql_innodb_cluster_metadata' (1049)

See https://dev.mysql.com/doc/mysql-shell/en/deploying-production-innodb-cluster.html for instructions on setting up a MySQL Server to act as an InnoDB Cluster Metadata server

2023-09-10 21:34:04 metadata_cache WARNING [7fc6e041a700] Failed fetching metadata from metadata server on 172.26.170.13:3306 - Expected MySQL Server '172.26.170.13:3306' to contain the metadata of MySQL InnoDB Cluster, but the schema does not exist.
Checking version of the metadata schema failed with: Error executing MySQL query "SELECT * FROM mysql_innodb_cluster_metadata.schema_version": Unknown database 'mysql_innodb_cluster_metadata' (1049)

See https://dev.mysql.com/doc/mysql-shell/en/deploying-production-innodb-cluster.html for instructions on setting up a MySQL Server to act as an InnoDB Cluster Metadata server

2023-09-10 21:34:04 metadata_cache WARNING [7fc6e041a700] Failed fetching metadata from metadata server on 172.26.170.14:3306 - Expected MySQL Server '172.26.170.14:3306' to contain the metadata of MySQL InnoDB Cluster, but the schema does not exist.
Checking version of the metadata schema failed with: Error executing MySQL query "SELECT * FROM mysql_innodb_cluster_metadata.schema_version": Unknown database 'mysql_innodb_cluster_metadata' (1049)

See https://dev.mysql.com/doc/mysql-shell/en/deploying-production-innodb-cluster.html for instructions on setting up a MySQL Server to act as an InnoDB Cluster Metadata server

为了重新建立连接,必须重新导入集群,以便再次创建元数据。

<code style="text-align: left;"> MySQL 172.26.170.13:3306 ssl Py > dba.create_cluster('GreatSQLMGR');
A new InnoDB cluster will be created on instance '172.26.170.13:3306'.

You are connected to an instance that belongs to an unmanaged replication group.
Do you want to setup an InnoDB cluster based on this replication group? [Y/n]: y
Creating InnoDB cluster 'GreatSQLMGR' on '172.26.170.13:3306'...

Adding Seed Instance...
Adding Instance '172.26.170.13:3306'...
Adding Instance '172.26.170.14:3306'...
Adding Instance '172.26.170.15:3306'...
Resetting distributed recovery credentials across the cluster...
NOTE: User 'mysql_innodb_cluster_3306171'@'%' already existed at instance '172.26.170.13:3306'. It will be deleted and created again with a new password.
NOTE: User 'mysql_innodb_cluster_33061023'@'%' already existed at instance '172.26.170.13:3306'. It will be deleted and created again with a new password.
NOTE: User 'mysql_innodb_cluster_3306596'@'%' already existed at instance '172.26.170.13:3306'. It will be deleted and created again with a new password.
Cluster successfully created based on existing replication group.

相关文章

Oracle如何使用授予和撤销权限的语法和示例
Awesome Project: 探索 MatrixOrigin 云原生分布式数据库
下载丨66页PDF,云和恩墨技术通讯(2024年7月刊)
社区版oceanbase安装
Oracle 导出CSV工具-sqluldr2
ETL数据集成丨快速将MySQL数据迁移至Doris数据库

发布评论