Related Documentation Download this Manual
PDF (US Ltr) - 37.4Mb
PDF (A4) - 37.4Mb
PDF (RPM) - 36.9Mb
EPUB - 10.6Mb
HTML Download (TGZ) - 10.3Mb
HTML Download (Zip) - 10.4Mb
HTML Download (RPM) - 9.0Mb
Eclipse Doc Plugin (TGZ) - 11.2Mb
Eclipse Doc Plugin (Zip) - 13.4Mb
Man Pages (TGZ) - 204.7Kb
Man Pages (Zip) - 311.7Kb
Info (Gzip) - 3.4Mb
Info (Zip) - 3.4Mb
Excerpts from this Manual

MySQL 5.7 Reference Manual  /  InnoDB Cluster User Guide  /  Working with an Existing Deployment of Group Replication

19.6 Working with an Existing Deployment of Group Replication

If you have an existing deployment of Group Replication and you want to manage it using the MySQL Shell, the option adoptFromGR from the dba.createCluster() function can be used.

If you have an open session to one of the members of the cluster, you can use the cluster.rescan() function to create and populate the cluster metadata. The rescan() function discovers new instances and reports instances that have left the cluster. You are prompted to add nodes into the cluster, or remove nodes from the cluster, as you require.

  
shell> mysqlsh --uri root@192.168.0.11:3306
  Creating a Session to 'root@192.168.0.11:3306'
  Enter password: ****
  Classic Session successfully established. No default schema selected.

MySQL Shell JavaScript Code:

  
mysql-js> var cluster = dba.createCluster('prodCluster', {adoptFromGR: true});

  A new InnoDB cluster will be created on instance 'root@192.168.0.11:3306'.

  Creating InnoDB cluster 'prodCluster' on 'root@192.168.0.11:3306'...
  Adding Seed Instance...

  Cluster successfully created. Use cluster.addInstance() to add MySQL instances.
  At least 3 instances are needed for the cluster to be able to withstand up to
  one server failure.
mysql-js> cluster.describe();
{
  "clusterName": "prodCluster",
  "adminType": "local",
  "defaultReplicaSet": {
      "name": "default",
      "instances": [
        {
          "name": "localhost:3306",
          "host": "localhost:3306",
          "role": "HA"
        },
        {
          "name": "localhost:3307",
          "host": "localhost:3307",
          "role": "HA"
        },
        {
          "name": "localhost:3308",
          "host": "localhost:3308",
          "role": "HA"
        }
     ]
  }
}

User Comments
Sign Up Login You must be logged in to post a comment.