暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Adopting a Group Replication Deployment

原创 忘忧草 2022-08-04
302

If you have an existing deployment of Group Replication and you want to use it to create a cluster, pass the adoptFromGR option to the dba.createCluster() function. The created InnoDB Cluster matches whether the replication group is running as single-primary or multi-primary.

To adopt an existing Group Replication group, connect to a group member using MySQL Shell. In the following example a single-primary group is adopted. We connect to gr-member-2, a secondary instance, while gr-member-1 is functioning as the group’s primary. Create a cluster using dba.createCluster(), passing in the adoptFromGR option. For example:

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

A new InnoDB cluster will be created on instance ‘root@gr-member-2:3306’.

Creating InnoDB cluster ‘prodCluster’ on ‘root@gr-member-2: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.
Tip
If the instance has super_read_only=ON then you might need to confirm that AdminAPI can set super_read_only=OFF. See Instance Configuration in Super Read-only Mode for more information.

If you do not specify adoptFromGR: true, and the target server instance belongs to a replication group, MySQL Shell prompts you to confirm whether you want to adopt the replication group. From MySQL Shell 8.0.29, if you specify adoptFromGR: false, the operation is stopped with no prompt if the instance is found to belong to a replication group.

The new cluster matches the mode of the group. If the adopted group was running in single-primary mode then a single-primary cluster is created. If the adopted group was running in multi-primary mode then a multi-primary cluster is created.

Note
It is not possible to define the communication stack used by the cluster in the same command as adoptFromGR, the cluster must initially use the communication stack used by the adopted group. If necessary, you can change the communication stack after the group is adopted using rebootClusterFromCompleteOutage. See Section 7.5.9, “Configuring the Group Replication Communication Stack”.

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论