删除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.