| 1 |
include/group_replication.inc [rpl_server_count=3] |
| 2 |
Warnings: |
| 3 |
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. |
| 4 |
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. |
| 5 |
[connection server1] |
| 6 |
|
| 7 |
############################################################ |
| 8 |
# 1. Setup Group Replication on server 1 and 2. |
| 9 |
[connection server1] |
| 10 |
include/start_and_bootstrap_group_replication.inc |
| 11 |
[connection server2] |
| 12 |
include/start_group_replication.inc |
| 13 |
|
| 14 |
############################################################ |
| 15 |
# 2. Disable GTIDs on server 3 |
| 16 |
[connection server3] |
| 17 |
include/rpl_set_gtid_mode.inc [OFF on servers 3] |
| 18 |
|
| 19 |
############################################################ |
| 20 |
# 3. Setup a asynchronous replication connection from server 3 |
| 21 |
# into the group (server 1) |
| 22 |
# Calculate the source_uuid |
| 23 |
[connection server1] |
| 24 |
CHANGE REPLICATION SOURCE TO SOURCE_HOST="127.0.0.1", SOURCE_USER="root", SOURCE_PASSWORD="", SOURCE_PORT=SERVER_3_PORT, ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS=LOCAL; |
| 25 |
Warnings: |
| 26 |
Note 4017 Using ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS creates limitations on the replication topology - you cannot fail over between downstream and upstream servers. Only use this option if it is not possible to enable GTIDs on the source, for instance, because of lack of permissions. If possible, use the procedure for enabling GTID transactions online instead, as described in the documentation. |
| 27 |
Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure. |
| 28 |
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. |
| 29 |
include/start_slave.inc |
| 30 |
|
| 31 |
################################################################### |
| 32 |
# 4. Execute some transactions on server 3 and sync with server 1 |
| 33 |
[connection server3] |
| 34 |
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; |
| 35 |
INSERT INTO t1 VALUES (0); |
| 36 |
INSERT INTO t1 VALUES (1); |
| 37 |
UPDATE t1 SET c1=2 WHERE c1=0; |
| 38 |
include/sync_slave_sql_with_master.inc |
| 39 |
|
| 40 |
############################################################ |
| 41 |
# 5. Execute a transaction on the group and sync |
| 42 |
[connection server1] |
| 43 |
INSERT INTO t1 VALUES (6); |
| 44 |
include/rpl_sync.inc |
| 45 |
|
| 46 |
############################################################ |
| 47 |
# 6. GTID_EXECUTED on server 1 must contain the transactions |
| 48 |
# from server 3. |
| 49 |
# Validate data on server 1. |
| 50 |
[connection server1] |
| 51 |
include/assert.inc [GTID_EXECUTED must contain server 4 GTID_EXECUTED from server 3 with server 1 UUID] |
| 52 |
include/assert.inc ['There is a value 1 in table t1'] |
| 53 |
include/assert.inc ['There is a value 2 in table t1'] |
| 54 |
include/assert.inc ['There is a value 6 in table t1'] |
| 55 |
|
| 56 |
############################################################ |
| 57 |
# 7. GTID_EXECUTED on server 2 must contain the transactions |
| 58 |
# from server 3. |
| 59 |
# Validate data on server 2. |
| 60 |
[connection server2] |
| 61 |
include/assert.inc [GTID_EXECUTED must contain server 4 GTID_EXECUTED from server 3 with server 1 UUID] |
| 62 |
include/assert.inc ['There is a value 1 in table t1'] |
| 63 |
include/assert.inc ['There is a value 2 in table t1'] |
| 64 |
include/assert.inc ['There is a value 6 in table t1'] |
| 65 |
|
| 66 |
############################################################ |
| 67 |
# 8. Cleanup |
| 68 |
[connection server3] |
| 69 |
DROP TABLE t1; |
| 70 |
include/sync_slave_sql_with_master.inc |
| 71 |
[connection server1] |
| 72 |
include/stop_slave.inc |
| 73 |
[connection server3] |
| 74 |
include/rpl_set_gtid_mode.inc [ON on servers 3] |
| 75 |
[connection server1] |
| 76 |
include/stop_group_replication.inc |
| 77 |
SET session sql_log_bin=0; |
| 78 |
CALL mtr.add_suppression("Using ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS implies limitations on the replication topology"); |
| 79 |
SET session sql_log_bin=1; |
| 80 |
# restart:--group_replication_group_name=GROUP_REPLICATION_GROUP_NAME --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=OFF |
| 81 |
include/rpl_reconnect.inc |
| 82 |
[connection server2] |
| 83 |
include/stop_group_replication.inc |
| 84 |
include/group_replication_end.inc |