Related Documentation Download this Manual
PDF (US Ltr) - 37.3Mb
PDF (A4) - 37.4Mb
PDF (RPM) - 36.7Mb
HTML Download (TGZ) - 10.2Mb
HTML Download (Zip) - 10.2Mb
HTML Download (RPM) - 8.8Mb
Man Pages (TGZ) - 210.2Kb
Man Pages (Zip) - 318.2Kb
Info (Gzip) - 3.4Mb
Info (Zip) - 3.4Mb
Excerpts from this Manual

MySQL 5.7 Reference Manual  /  InnoDB Cluster User Guide  /  Creating an InnoDB Cluster From an Existing Group Replication Deployment

19.6 Creating an InnoDB Cluster From an Existing Group Replication Deployment

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.

  
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.