| 1 |
include/group_replication.inc [rpl_server_count=3] |
| 2 |
Warnings: |
| 3 |
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. |
| 4 |
Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information. |
| 5 |
[connection server1] |
| 6 |
|
| 7 |
# 1. Fetch server uuid of all the members. |
| 8 |
[connection server3] |
| 9 |
[connection server2] |
| 10 |
|
| 11 |
# 2. Execute group action switch to primary mode on server2 to set |
| 12 |
# server3 as primary. |
| 13 |
SELECT group_replication_switch_to_single_primary_mode("MEMBER3_UUID"); |
| 14 |
group_replication_switch_to_single_primary_mode("MEMBER3_UUID") |
| 15 |
Mode switched to single-primary successfully. |
| 16 |
|
| 17 |
# 3. Verify that secondaries: server1, server2 and primary: server3. |
| 18 |
include/gr_assert_secondary_member.inc |
| 19 |
[connection server1] |
| 20 |
include/gr_assert_secondary_member.inc |
| 21 |
[connection server3] |
| 22 |
include/gr_assert_primary_member.inc |
| 23 |
|
| 24 |
# 4. Execute action on a secondary server1 to make another secondary |
| 25 |
# server2 as primary. |
| 26 |
[connection server1] |
| 27 |
SELECT group_replication_set_as_primary("MEMBER2_UUID"); |
| 28 |
group_replication_set_as_primary("MEMBER2_UUID") |
| 29 |
Primary server switched to: MEMBER2_UUID |
| 30 |
|
| 31 |
# 5. Verify that secondaries: server1, server3 and primary: server2. |
| 32 |
include/gr_assert_secondary_member.inc |
| 33 |
[connection server3] |
| 34 |
include/gr_assert_secondary_member.inc |
| 35 |
[connection server2] |
| 36 |
include/gr_assert_primary_member.inc |
| 37 |
|
| 38 |
# 6. Execute action on a primary server2 to make a secondary server3 |
| 39 |
# as primary. |
| 40 |
SELECT group_replication_set_as_primary("MEMBER3_UUID"); |
| 41 |
group_replication_set_as_primary("MEMBER3_UUID") |
| 42 |
Primary server switched to: MEMBER3_UUID |
| 43 |
|
| 44 |
# 7. Verify that secondaries: server1, server2 and primary: server3. |
| 45 |
include/gr_assert_secondary_member.inc |
| 46 |
[connection server1] |
| 47 |
include/gr_assert_secondary_member.inc |
| 48 |
[connection server3] |
| 49 |
include/gr_assert_primary_member.inc |
| 50 |
|
| 51 |
# 8. Execute action on a secondary server1 to make itself as primary. |
| 52 |
[connection server1] |
| 53 |
SELECT group_replication_set_as_primary("MEMBER1_UUID"); |
| 54 |
group_replication_set_as_primary("MEMBER1_UUID") |
| 55 |
Primary server switched to: MEMBER1_UUID |
| 56 |
|
| 57 |
# 9. Verify that secondaries: server2, server3 and primary: server1. |
| 58 |
include/gr_assert_primary_member.inc |
| 59 |
[connection server3] |
| 60 |
include/gr_assert_secondary_member.inc |
| 61 |
[connection server2] |
| 62 |
include/gr_assert_secondary_member.inc |
| 63 |
|
| 64 |
# 10. Clean up. |
| 65 |
include/group_replication_end.inc |