| 1 |
include/group_replication.inc [rpl_server_count=4] |
| 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 |
############################################################ |
| 8 |
# 1. Deploy a 3 members group in single primary mode. |
| 9 |
[connection server1] |
| 10 |
include/start_and_bootstrap_group_replication.inc |
| 11 |
[connection server2] |
| 12 |
include/start_group_replication.inc |
| 13 |
[connection server3] |
| 14 |
include/start_group_replication.inc |
| 15 |
|
| 16 |
############################################################ |
| 17 |
# 2. Add manually the third member of group to the list of |
| 18 |
# unmanaged sources of the replica. |
| 19 |
[connection server4] |
| 20 |
SELECT asynchronous_connection_failover_add_source('ch1', '127.0.0.1', SERVER_MYPORT_3, '', 90);; |
| 21 |
asynchronous_connection_failover_add_source('ch1', '127.0.0.1', SERVER_MYPORT_3, '', 90) |
| 22 |
The UDF asynchronous_connection_failover_add_source() executed successfully. |
| 23 |
############################################################ |
| 24 |
# 3. Configure replica to manage the asynchronous connection |
| 25 |
# to group A. |
| 26 |
|
| 27 |
[connection server4] |
| 28 |
SELECT asynchronous_connection_failover_add_managed('ch1', 'GroupReplication', 'GROUP', '127.0.0.1', SERVER_MYPORT_2, '', 80, 70);; |
| 29 |
asynchronous_connection_failover_add_managed('ch1', 'GroupReplication', 'GROUP', '127.0.0.1', SERVER_MYPORT_2, '', 80, 70) |
| 30 |
The UDF asynchronous_connection_failover_add_managed() executed successfully. |
| 31 |
############################################################ |
| 32 |
# 4. Create and start the managed channel. |
| 33 |
# Replica will connect to server3 (weigth: 90). |
| 34 |
[connection server4] |
| 35 |
CHANGE REPLICATION SOURCE TO SOURCE_HOST='127.0.0.1', SOURCE_USER='root', SOURCE_AUTO_POSITION=1, SOURCE_CONNECTION_AUTO_FAILOVER=1, SOURCE_PORT=SERVER_1_PORT, SOURCE_CONNECT_RETRY=1, SOURCE_RETRY_COUNT=1 FOR CHANNEL 'ch1'; |
| 36 |
Warnings: |
| 37 |
Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure. |
| 38 |
Note 1760 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. |
| 39 |
include/start_slave.inc [FOR CHANNEL 'ch1'] |
| 40 |
SELECT * FROM performance_schema.replication_asynchronous_connection_failover ORDER BY weight DESC; |
| 41 |
CHANNEL_NAME HOST PORT NETWORK_NAMESPACE WEIGHT MANAGED_NAME |
| 42 |
ch1 127.0.0.1 PORT 90 |
| 43 |
ch1 127.0.0.1 PORT 80 aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa |
| 44 |
ch1 127.0.0.1 PORT 70 aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa |
| 45 |
ch1 127.0.0.1 PORT 70 aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa |
| 46 |
Wait until ch1 IO_THREAD is connected to server3 |
| 47 |
############################################################ |
| 48 |
# 5. Remove the manually added server3 from the sources list. |
| 49 |
# Replica will connect to server1 (weigth: 80). |
| 50 |
[connection server4] |
| 51 |
SELECT asynchronous_connection_failover_delete_source('ch1', '127.0.0.1', SERVER_MYPORT_3, '');; |
| 52 |
asynchronous_connection_failover_delete_source('ch1', '127.0.0.1', SERVER_MYPORT_3, '') |
| 53 |
The UDF asynchronous_connection_failover_delete_source() executed successfully. |
| 54 |
include/assert.inc ['There are 0 rows in performance_schema.replication_asynchronous_connection_failover for single servers'] |
| 55 |
include/assert.inc ['There are 3 rows in performance_schema.replication_asynchronous_connection_failover belonging to the group'] |
| 56 |
SELECT * FROM performance_schema.replication_asynchronous_connection_failover ORDER BY weight DESC; |
| 57 |
CHANNEL_NAME HOST PORT NETWORK_NAMESPACE WEIGHT MANAGED_NAME |
| 58 |
ch1 127.0.0.1 PORT 80 aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa |
| 59 |
ch1 127.0.0.1 PORT 70 aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa |
| 60 |
ch1 127.0.0.1 PORT 70 aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa |
| 61 |
Wait until ch1 IO_THREAD is connected to server1 |
| 62 |
############################################################ |
| 63 |
# 6. Clean up. |
| 64 |
[connection server4] |
| 65 |
SET SESSION sql_log_bin = 0; |
| 66 |
call mtr.add_suppression("The source .* for channel 'ch1' has joined the group .*, and so added its entry into replication_asynchronous_connection_failover table."); |
| 67 |
call mtr.add_suppression("The group .* for the channel .* has been removed, and so removed its entry from replication_asynchronous_connection_failover_managed and all the group members from replication_asynchronous_connection_failover table."); |
| 68 |
call mtr.add_suppression("The group .* for the channel .* has been added, and so added its entry in replication_asynchronous_connection_failover_managed and source to replication_asynchronous_connection_failover table."); |
| 69 |
SET SESSION sql_log_bin = 1; |
| 70 |
include/stop_slave.inc [FOR CHANNEL 'ch1'] |
| 71 |
include/rpl_reset_slave.inc |
| 72 |
SELECT asynchronous_connection_failover_delete_managed('ch1', 'GROUP'); |
| 73 |
asynchronous_connection_failover_delete_managed('ch1', 'GROUP') |
| 74 |
The UDF asynchronous_connection_failover_delete_managed() executed successfully. |
| 75 |
[connection server3] |
| 76 |
include/stop_group_replication.inc |
| 77 |
[connection server2] |
| 78 |
include/stop_group_replication.inc |
| 79 |
[connection server1] |
| 80 |
include/stop_group_replication.inc |
| 81 |
include/group_replication_end.inc |