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
|
include/group_replication.inc [rpl_server_count=4]
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]
############################################################
# 1. Deploy a 3 members group in single primary mode.
[connection server1]
include/start_and_bootstrap_group_replication.inc
[connection server2]
include/start_group_replication.inc
[connection server3]
include/start_group_replication.inc
############################################################
# 2. Configure replica to manage the asynchronous connection
# to the group.
[connection server4]
SELECT asynchronous_connection_failover_add_managed('ch1', 'GroupReplication', 'GROUP', '127.0.0.1', SERVER_MYPORT_2, '', 80, 70);;
asynchronous_connection_failover_add_managed('ch1', 'GroupReplication', 'GROUP', '127.0.0.1', SERVER_MYPORT_2, '', 80, 70)
The UDF asynchronous_connection_failover_add_managed() executed successfully.
###########################################################
# 3. Create and start the managed channel.
# Replica will connect to server1 (weigth: 80).
[connection server4]
SET @@GLOBAL.DEBUG='+d,rpl_acf_simulate_57_source';
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_3_PORT, SOURCE_CONNECT_RETRY=1, SOURCE_RETRY_COUNT=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.
include/start_slave.inc [FOR CHANNEL 'ch1']
SELECT * FROM performance_schema.replication_asynchronous_connection_failover ORDER BY weight DESC;
CHANNEL_NAME HOST PORT NETWORK_NAMESPACE WEIGHT MANAGED_NAME
ch1 127.0.0.1 PORT 80 aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
ch1 127.0.0.1 PORT 70 aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
ch1 127.0.0.1 PORT 70 aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
Wait until ch1 IO_THREAD is connected to server1
############################################################
# 4. Switch group to multi-primary mode.
# Validate that group sources weight is updated.
[connection server1]
SELECT group_replication_switch_to_multi_primary_mode();
group_replication_switch_to_multi_primary_mode()
Mode switched to multi-primary successfully.
[connection server4]
SELECT * FROM performance_schema.replication_asynchronous_connection_failover ORDER BY weight DESC;
CHANNEL_NAME HOST PORT NETWORK_NAMESPACE WEIGHT MANAGED_NAME
ch1 127.0.0.1 PORT 80 aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
ch1 127.0.0.1 PORT 80 aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
ch1 127.0.0.1 PORT 80 aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
include/assert.inc [Verify channel ch1 IO_THREAD is ON and connected to server1]
############################################################
# 5. Clean up.
[connection server4]
include/stop_slave.inc [FOR CHANNEL 'ch1']
include/rpl_reset_slave.inc
SELECT asynchronous_connection_failover_delete_managed('ch1', 'GROUP');
asynchronous_connection_failover_delete_managed('ch1', 'GROUP')
The UDF asynchronous_connection_failover_delete_managed() executed successfully.
SET @@GLOBAL.DEBUG='-d,rpl_acf_simulate_57_source';
[connection server3]
SELECT group_replication_switch_to_single_primary_mode("SERVER1");
group_replication_switch_to_single_primary_mode("SERVER1")
Mode switched to single-primary successfully.
include/stop_group_replication.inc
[connection server2]
include/stop_group_replication.inc
[connection server1]
include/stop_group_replication.inc
include/group_replication_end.inc
|