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 master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE 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 master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE 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] SET SESSION sql_log_bin = 0; call mtr.add_suppression("The master's UUID has changed, although this should not happen unless you have changed it manually."); SET SESSION sql_log_bin = 1; 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