Rate This Document
Findability
Accuracy
Completeness
Readability

Switching the MGR Role

  1. Specify the ID of the member to be switched.
    show variables like '%server_%';
    SELECT * FROM performance_schema.replication_group_members;
  2. Switch the MGR role.
    SELECT group_replication_set_as_primary('Replace it with the member_id of the target primary database');

    For example:

    SELECT group_replication_set_as_primary('e44f902b-bf50-11ea-89d7-000000536bb6');
    +--------------------------------------------------------------------------+
    | group_replication_set_as_primary('e44f902b-bf50-11ea-89d7-000000536bb6') |
    +--------------------------------------------------------------------------+
    | Primary server switched to: e44f902b-bf50-11ea-89d7-000000536bb6         |
    +--------------------------------------------------------------------------+
    1 row in set (1.00 sec)

Confirm the switchover progress.

SELECT event_name, work_completed, work_estimated FROM performance_schema.events_stages_current WHERE event_name LIKE "%stage/group_rpl%";