1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
|
include/group_replication.inc [rpl_server_count=5]
Warnings:
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
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.
[connection server1]
[connection server2]
[connection server3]
[connection server4]
[connection server5]
#
# 1. Deploy a 3 members receiver group in single primary mode.
#
[connection server1]
SET GLOBAL GROUP_REPLICATION_GROUP_SEEDS= "LOCAL_ADDRESS_SERVER1, LOCAL_ADDRESS_SERVER2";
include/start_and_bootstrap_group_replication.inc
[connection server2]
CHANGE REPLICATION SOURCE TO SOURCE_HOST='127.0.0.1', SOURCE_USER='root', SOURCE_AUTO_POSITION=1, SOURCE_PORT=SERVER_4_PORT, SOURCE_CONNECT_RETRY=1, SOURCE_RETRY_COUNT=1, SOURCE_CONNECTION_AUTO_FAILOVER=1 FOR CHANNEL 'ch1';
Warnings:
Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure.
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.
SET GLOBAL GROUP_REPLICATION_GROUP_SEEDS= "LOCAL_ADDRESS_SERVER1, LOCAL_ADDRESS_SERVER2";
include/start_group_replication.inc
#
# 2. Deploy a 2 members sender group in single primary mode.
# The third member of the group i.e. server5 will be added later
# to verify changes are getting synced to receiver group members.
#
[connection server3]
SET GLOBAL GROUP_REPLICATION_GROUP_SEEDS= "LOCAL_ADDRESS_SERVER3, LOCAL_ADDRESS_SERVER4, LOCAL_ADDRESS_SERVER5";
include/start_and_bootstrap_group_replication.inc
[connection server4]
SET GLOBAL GROUP_REPLICATION_GROUP_SEEDS= "LOCAL_ADDRESS_SERVER3, LOCAL_ADDRESS_SERVER4, LOCAL_ADDRESS_SERVER5";
include/start_group_replication.inc
# 3. Create a replication channel to replicate from server3 to
# server1.
[connection server1]
CHANGE REPLICATION SOURCE TO SOURCE_HOST='127.0.0.1', SOURCE_USER='root', SOURCE_AUTO_POSITION=1, SOURCE_PORT=SERVER_4_PORT, SOURCE_CONNECT_RETRY=1, SOURCE_RETRY_COUNT=1, SOURCE_CONNECTION_AUTO_FAILOVER=1 FOR CHANNEL 'ch1';
Warnings:
Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure.
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.
# 4. Add replication connection details of managed channel ch1
# to replication_asynchronous_connection_failover_managed table
# through asynchronous_connection_failover_add_managed() UDF.
SELECT asynchronous_connection_failover_add_managed('ch1', 'GroupReplication', "GROUP_B",'127.0.0.1', SERVER_MYPORT_4, '', 80, 60);
asynchronous_connection_failover_add_managed('ch1', 'GroupReplication', "GROUP_B",'127.0.0.1', SERVER_MYPORT_4, '', 80, 60)
The UDF asynchronous_connection_failover_add_managed() executed successfully.
# 5. Start replica for channel ch1.
include/start_slave.inc [FOR CHANNEL 'ch1']
# 6. Verify replication_asynchronous_connection_failover on
# server1 has two rows and member action configuration version
# value for replication_asynchronous_connection_failover
# and for replication_asynchronous_connection_failover_managed.
# 7. Verify replication_asynchronous_connection_failover on
# server2 has two rows and member action configuration version
# value for replication_asynchronous_connection_failover
# and for replication_asynchronous_connection_failover_managed.
[connection server2]
#
# 8. Add another member i.e. server5 to sender group.
#
[connection server5]
SET GLOBAL GROUP_REPLICATION_GROUP_SEEDS= "LOCAL_ADDRESS_SERVER3, LOCAL_ADDRESS_SERVER4, LOCAL_ADDRESS_SERVER5";
include/start_group_replication.inc
include/assert.inc [There are three members in the group.]
# 9. Verify replication_asynchronous_connection_failover on
# server1 has three rows and member action configuration version
# value for replication_asynchronous_connection_failover
# and for replication_asynchronous_connection_failover_managed.
[connection server1]
# 10. Verify replication_asynchronous_connection_failover on
# server2 has three rows and member action configuration version
# value for replication_asynchronous_connection_failover
# and for replication_asynchronous_connection_failover_managed.
[connection server2]
# 11. Delete replication connection details for managed channel ch1
# from replication_asynchronous_connection_failover_managed
# and replication_asynchronous_connection_failover table
# through asynchronous_connection_failover_delete_managed() UDF.
[connection server1]
SELECT asynchronous_connection_failover_delete_managed('ch1', 'GROUP_B');
asynchronous_connection_failover_delete_managed('ch1', 'GROUP_B')
The UDF asynchronous_connection_failover_delete_managed() executed successfully.
# 12. Verify replication_asynchronous_connection_failover on
# server1 is empty and member action configuration version
# value for replication_asynchronous_connection_failover
# and for replication_asynchronous_connection_failover_managed.
# 13. Verify replication_asynchronous_connection_failover on
# server2 is empty and member action configuration version
# value for replication_asynchronous_connection_failover
# and for replication_asynchronous_connection_failover_managed.
[connection server2]
#
# 14. Clean up.
#
[connection server1]
include/stop_slave.inc [FOR CHANNEL 'ch1']
include/rpl_reset_slave.inc
[connection server5]
include/stop_group_replication.inc
[connection server4]
include/stop_group_replication.inc
[connection server3]
include/stop_group_replication.inc
[connection server2]
include/stop_group_replication.inc
include/rpl_reset_slave.inc
[connection server1]
include/stop_group_replication.inc
include/group_replication_end.inc
|