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
|
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. server1 start group replication and server2 join
include/start_and_bootstrap_group_replication.inc
[connection server2]
include/start_group_replication.inc
# 2. server1 have a slave connection to server3
[connection server1]
CHANGE REPLICATION SOURCE TO SOURCE_HOST='localhost', SOURCE_USER='root', SOURCE_PORT=SERVER_3_PORT for channel 'ch3_1';
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 'ch3_1']
#
# 3. server2 have a slave connection to server4
[connection server2]
CHANGE REPLICATION SOURCE TO SOURCE_HOST='localhost', SOURCE_USER='root', SOURCE_PORT=SERVER_4_PORT for channel 'ch4_2';
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 'ch4_2']
# 4. Execute action to single primary mode. It shall fail as more than
# one server has slave connections
[connection server2]
SELECT group_replication_switch_to_single_primary_mode();
ERROR HY000: The function 'group_replication_switch_to_single_primary_mode' failed. There is more than a member in the group with running replica channels so no primary can be elected.
include/gr_assert_multi_primary_mode.inc
[connection server1]
include/gr_assert_multi_primary_mode.inc
# 5. Cleanup
STOP SLAVE FOR CHANNEL 'ch3_1';
Warnings:
Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
RESET SLAVE ALL FOR CHANNEL 'ch3_1';
Warnings:
Warning 1287 'RESET SLAVE' is deprecated and will be removed in a future release. Please use RESET REPLICA instead
set session sql_log_bin=0;
call mtr.add_suppression("Error while executing a group configuration operation: There is more than a member in the group with running replica channels*");
set session sql_log_bin=1;
[connection server2]
STOP SLAVE FOR CHANNEL 'ch4_2';
Warnings:
Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead
RESET SLAVE ALL FOR CHANNEL 'ch4_2';
Warnings:
Warning 1287 'RESET SLAVE' is deprecated and will be removed in a future release. Please use RESET REPLICA instead
set session sql_log_bin=0;
call mtr.add_suppression("The function 'group_replication_switch_to_single_primary_mode' failed. There is more than a member in the group with running replica channels*");
set session sql_log_bin=1;
include/group_replication_end.inc
|