Dissolve MySQL Innodb Cluster
Dissolve MySQL Innodb Cluster
Dissolving MySQL InnoDB Cluster
To dissolve an InnoDB cluster you connect to a read-write instance, for example the primary in a single-primary cluster, and use the Cluster.dissolve() command. This removes all metadata and configuration associated with the cluster, and disables Group Replication on the instances. Any data that was replicated between the instances is not removed. There is no way to undo the dissolving of a cluster, therefore you must pass force: true to confirm you want to dissolve the cluster. For example: to create it again use dba.createCluster().
var cluster = dba.getCluster()
mysql-js> cluster.dissolve({force:true})
root@mysqlhost01:~# mysqlsh --uri clusteradmin@mysqlhost01:3306
Please provide the password for 'clusteradmin@mysqlhost01:3306': ************************
Save password for 'clusteradmin@mysqlhost01:3306'? [Y]es/[N]o/Ne[v]er (default No):
MySQL Shell 8.0.17
Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.
Type '\help' or '\?' for help; '\quit' to exit.
Creating a session to 'clusteradmin@mysqlhost01:3306'
Fetching schema names for autocompletion... Press ^C to stop.
Your MySQL connection id is 590
Server version: 8.0.17 MySQL Community Server - GPL
No default schema selected; type \use <schema> to set one.
MySQL mysqlhost01:3306 ssl JS >
MySQL mysqlhost01:3306 ssl JS >
MySQL mysqlhost01:3306 ssl JS > cluster.dissolve({force:true});
ReferenceError: cluster is not defined
MySQL mysqlhost01:3306 ssl JS > var cluster = dba.getCluster()
MySQL mysqlhost01:3306 ssl JS > cluster.dissolve({force:true});
The cluster still has the following registered ReplicaSets:
{
"clusterName": "MySQLCluster",
"defaultReplicaSet": {
"name": "default",
"topology": [
{
"address": "mysqlhost02:3306",
"label": "mysqlhost02:3306",
"role": "HA",
"version": "8.0.17"
},
{
"address": "mysqlhost01:3306",
"label": "mysqlhost01:3306",
"role": "HA",
"version": "8.0.17"
}
],
"topologyMode": "Single-Primary"
}
}
WARNING: You are about to dissolve the whole cluster and lose the high availability features provided by it. This operation cannot be reverted. All members will be removed from their ReplicaSet and replication will be stopped, internal recovery user accounts and the cluster metadata will be dropped. User data will be maintained intact in all instances.
Are you sure you want to dissolve the cluster? [y/N]: Y
Instance 'mysqlhost02:3306' is attempting to leave the cluster...
Instance 'mysqlhost01:3306' is attempting to leave the cluster...
The cluster was successfully dissolved.
Replication was disabled but user data was left intact.
MySQL mysqlhost01:3306 ssl JS >
Once above step is done, You can decommission individual node after erasing data from the MySQL data-dir directory.
Introducing InnoDB Cluster: Learning the MySQL High Availability Stack
MySQL Cookbook: Solutions for Database Developers and Administrators
1)MySQL InnoDB Cluster node Addition Issue: - Cluster.addInstance: : MySQL server has gone away (RuntimeError)
2)Install & Configure MySQL Router - MySQL InnoDB Cluster
Comments
Post a Comment
Please do not enter any spam link in comment Section suggestions are Always Appreciated. Thanks.. !