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
|
include/group_replication.inc
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. Bootstrap M1.
include/start_and_bootstrap_group_replication.inc
# 2. Create user u1 on M2.
# Add PRIVILEGE_CHECKS_USER for u1 for GR applier channel.
# Reset master.
[connection server2]
SET SQL_LOG_BIN=0;
CREATE USER 'u1'@'localhost';
SET SQL_LOG_BIN=1;
CHANGE REPLICATION SOURCE TO PRIVILEGE_CHECKS_USER = 'u1'@'localhost' FOR CHANNEL "group_replication_applier";
CHANGE REPLICATION SOURCE TO PRIVILEGE_CHECKS_USER = 'root'@'localhost' FOR CHANNEL "group_replication_recovery";
RESET MASTER;
# 3. Start GR fails.
# Assert value of PRIVILEGE_CHECKS_USER is preserved.
SET GLOBAL GROUP_REPLICATION_GROUP_NAME = "GROUP_REPLICATION_GROUP_NAME";
START GROUP_REPLICATION;
include/assert.inc [PRIVILEGE_CHECKS_USER has correct value for channel group_replication_applier]
# 4. Give privileges to u1.
# Start GR.
# Assert value of PRIVILEGE_CHECKS_USER is preserved.
SET GLOBAL super_read_only= 0;
SET SQL_LOG_BIN=0;
GRANT REPLICATION_APPLIER, SYSTEM_VARIABLES_ADMIN ON *.* TO 'u1'@'localhost';
SET SQL_LOG_BIN=1;
include/start_group_replication.inc
include/assert.inc [PRIVILEGE_CHECKS_USER has correct value for channel group_replication_applier and group_replication_recovery]
# 5. Stop GR.
# Assert value of PRIVILEGE_CHECKS_USER is preserved.
include/stop_group_replication.inc
include/assert.inc [PRIVILEGE_CHECKS_USER has correct value for channel group_replication_applier and group_replication_recovery]
# 6. Cleanup.
SET GLOBAL super_read_only= 0;
SET SQL_LOG_BIN=0;
DROP USER 'u1'@'localhost';
SET SQL_LOG_BIN=1;
SET SESSION sql_log_bin = 0;
call mtr.add_suppression(" Replica SQL for channel 'group_replication_applier': PRIVILEGE_CHECKS_USER for replication channel *");
call mtr.add_suppression("The applier thread execution was aborted. *");
call mtr.add_suppression("Fatal error during execution on the Applier process of Group Replication. The server will now leave the group.");
call mtr.add_suppression("Unable to confirm whether the server has left the group or not. *");
call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
call mtr.add_suppression("Unable to initialize the Group Replication applier module.");
call mtr.add_suppression("There was a previous plugin error while the member joined the group. The member will now exit the group.");
SET SESSION sql_log_bin = 1;
include/group_replication_end.inc
|