| 1 |
# restart:--group_replication_local_address=GROUP_REPLICATION_LOCAL_ADDRESS --group_replication_group_seeds=GROUP_REPLICATION_GROUP_SEEDS --group_replication_bootstrap_group=1 --group_replication_start_on_boot=1 |
| 2 |
# |
| 3 |
# On server 1 stop group replication that started at boot |
| 4 |
# |
| 5 |
include/stop_group_replication.inc |
| 6 |
# |
| 7 |
# On server 2 before start, create a replication user that requires SSL |
| 8 |
# |
| 9 |
set session sql_log_bin=0; |
| 10 |
CREATE USER 'rec_ssl_user'@'%' REQUIRE SSL; |
| 11 |
GRANT replication slave ON *.* TO 'rec_ssl_user'@'%'; |
| 12 |
GRANT GROUP_REPLICATION_STREAM ON *.* TO 'rec_ssl_user'@'%'; |
| 13 |
FLUSH PRIVILEGES; |
| 14 |
set session sql_log_bin=1; |
| 15 |
SET GLOBAL group_replication_ssl_mode= REQUIRED; |
| 16 |
# |
| 17 |
# Start the member and add some data |
| 18 |
# |
| 19 |
include/start_and_bootstrap_group_replication.inc |
| 20 |
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; |
| 21 |
INSERT INTO t1 VALUES (1); |
| 22 |
# |
| 23 |
# On server 1 restart the server. Group replication should start at boot |
| 24 |
# |
| 25 |
set session sql_log_bin=0; |
| 26 |
CREATE USER 'rec_ssl_user'@'%' REQUIRE SSL; |
| 27 |
GRANT replication slave ON *.* TO 'rec_ssl_user'@'%'; |
| 28 |
GRANT GROUP_REPLICATION_STREAM ON *.* TO 'rec_ssl_user'@'%'; |
| 29 |
FLUSH PRIVILEGES; |
| 30 |
set session sql_log_bin=1; |
| 31 |
SET GLOBAL group_replication_ssl_mode= REQUIRED; |
| 32 |
CHANGE REPLICATION SOURCE TO SOURCE_USER= 'rec_ssl_user' FOR CHANNEL 'group_replication_recovery'; |
| 33 |
# restart:--group_replication_local_address=GROUP_REPLICATION_LOCAL_ADDRESS --group_replication_group_seeds=GROUP_REPLICATION_GROUP_SEEDS --group_replication_start_on_boot=1 --group_replication_ssl_mode=REQUIRED |
| 34 |
include/gr_wait_for_member_state.inc |
| 35 |
# |
| 36 |
# On server 1 after restart, recovery should be successful |
| 37 |
# |
| 38 |
include/assert.inc [On the recovered member, the table should exist and have 1 elements;] |
| 39 |
INSERT INTO t1 VALUES (2); |
| 40 |
# |
| 41 |
# Cleanup |
| 42 |
# |
| 43 |
DROP TABLE t1; |
| 44 |
set session sql_log_bin=0; |
| 45 |
DROP USER 'rec_ssl_user'; |
| 46 |
set session sql_log_bin=1; |
| 47 |
include/stop_group_replication.inc |
| 48 |
RESET SLAVE ALL FOR CHANNEL "group_replication_applier"; |
| 49 |
Warnings: |
| 50 |
Warning 1287 'RESET SLAVE' is deprecated and will be removed in a future release. Please use RESET REPLICA instead |
| 51 |
RESET MASTER; |
| 52 |
include/stop_group_replication.inc |
| 53 |
RESET SLAVE ALL FOR CHANNEL "group_replication_applier"; |
| 54 |
Warnings: |
| 55 |
Warning 1287 'RESET SLAVE' is deprecated and will be removed in a future release. Please use RESET REPLICA instead |
| 56 |
RESET MASTER; |
| 57 |
[connection server1] |
| 58 |
SET SESSION sql_log_bin=0; |
| 59 |
DROP USER 'rec_ssl_user'; |
| 60 |
SET SESSION sql_log_bin=1; |