| 1 |
include/group_replication.inc [rpl_server_count=4] |
| 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 |
# 1. Start a single server |
| 8 |
####################################################### |
| 9 |
|
| 10 |
## START SERVER 1 |
| 11 |
[connection server1] |
| 12 |
include/start_and_bootstrap_group_replication.inc |
| 13 |
include/gr_wait_primary_member_uuid.inc |
| 14 |
|
| 15 |
## START SERVERS 2-4 |
| 16 |
[connection server2] |
| 17 |
include/start_group_replication.inc |
| 18 |
include/gr_wait_primary_member_uuid.inc |
| 19 |
[connection server3] |
| 20 |
include/start_group_replication.inc |
| 21 |
include/gr_wait_primary_member_uuid.inc |
| 22 |
[connection server4] |
| 23 |
include/start_group_replication.inc |
| 24 |
include/gr_wait_primary_member_uuid.inc |
| 25 |
|
| 26 |
## TRY TO CREATE TABLES test1 TO test4 ON CORESPONDING SERVERS 1-4 |
| 27 |
[connection server1] |
| 28 |
CREATE TABLE test1(`id` INT PRIMARY KEY AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL);; |
| 29 |
INSERT INTO test1(`name`) VALUES("First ROW"), ("Second ROW"), ("Third ROW");; |
| 30 |
INSERT INTO test1(`name`) VALUES("First ROW created in second query"), ("Second ROW created in second query");; |
| 31 |
UPDATE test1 SET `name`="2 ROW" WHERE `name` LIKE '%Second%';; |
| 32 |
include/rpl_sync.inc |
| 33 |
[connection server2] |
| 34 |
CREATE TABLE test2(`id` INT PRIMARY KEY AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL);; |
| 35 |
ERROR HY000: The MySQL server is running with the --super-read-only option so it cannot execute this statement |
| 36 |
INSERT INTO test2(`name`) VALUES("First ROW"), ("Second ROW"), ("Third ROW");; |
| 37 |
ERROR HY000: The MySQL server is running with the --super-read-only option so it cannot execute this statement |
| 38 |
INSERT INTO test2(`name`) VALUES("First ROW created in second query"), ("Second ROW created in second query");; |
| 39 |
ERROR HY000: The MySQL server is running with the --super-read-only option so it cannot execute this statement |
| 40 |
UPDATE test2 SET `name`="2 ROW" WHERE `name` LIKE '%Second%';; |
| 41 |
ERROR HY000: The MySQL server is running with the --super-read-only option so it cannot execute this statement |
| 42 |
include/rpl_sync.inc |
| 43 |
[connection server3] |
| 44 |
CREATE TABLE test3(`id` INT PRIMARY KEY AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL);; |
| 45 |
ERROR HY000: The MySQL server is running with the --super-read-only option so it cannot execute this statement |
| 46 |
INSERT INTO test3(`name`) VALUES("First ROW"), ("Second ROW"), ("Third ROW");; |
| 47 |
ERROR HY000: The MySQL server is running with the --super-read-only option so it cannot execute this statement |
| 48 |
INSERT INTO test3(`name`) VALUES("First ROW created in second query"), ("Second ROW created in second query");; |
| 49 |
ERROR HY000: The MySQL server is running with the --super-read-only option so it cannot execute this statement |
| 50 |
UPDATE test3 SET `name`="2 ROW" WHERE `name` LIKE '%Second%';; |
| 51 |
ERROR HY000: The MySQL server is running with the --super-read-only option so it cannot execute this statement |
| 52 |
include/rpl_sync.inc |
| 53 |
[connection server4] |
| 54 |
CREATE TABLE test4(`id` INT PRIMARY KEY AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL);; |
| 55 |
ERROR HY000: The MySQL server is running with the --super-read-only option so it cannot execute this statement |
| 56 |
INSERT INTO test4(`name`) VALUES("First ROW"), ("Second ROW"), ("Third ROW");; |
| 57 |
ERROR HY000: The MySQL server is running with the --super-read-only option so it cannot execute this statement |
| 58 |
INSERT INTO test4(`name`) VALUES("First ROW created in second query"), ("Second ROW created in second query");; |
| 59 |
ERROR HY000: The MySQL server is running with the --super-read-only option so it cannot execute this statement |
| 60 |
UPDATE test4 SET `name`="2 ROW" WHERE `name` LIKE '%Second%';; |
| 61 |
ERROR HY000: The MySQL server is running with the --super-read-only option so it cannot execute this statement |
| 62 |
include/rpl_sync.inc |
| 63 |
|
| 64 |
## STOP SERVER 1 AND START IT AGAIN (MAKE IT TO SECONDARY NODE) |
| 65 |
[connection server1] |
| 66 |
include/stop_group_replication.inc |
| 67 |
include/start_group_replication.inc |
| 68 |
|
| 69 |
## FIND NEW PRIMARY SERVER AND INSERT DATA ON PRIMARY |
| 70 |
include/gr_find_a_primary.inc |
| 71 |
INSERT INTO test1(`name`) VALUES("First ROW created in third query"), ("Second ROW created in third query"); |
| 72 |
INSERT INTO test1(`name`) VALUES("First ROW created in fourth query"), ("Second ROW created in fourth query"); |
| 73 |
UPDATE test1 SET `name`="3 query" WHERE `name` LIKE '%third query%'; |
| 74 |
UPDATE test1 SET `name`="Second ROW" WHERE `name` LIKE '%2 ROW%'; |
| 75 |
include/rpl_sync.inc |
| 76 |
|
| 77 |
## CHECK SECONDARY SERVERS THAT ARE SET IN READ ONLY MODE |
| 78 |
TRUNCATE TABLE `test1`; |
| 79 |
ERROR HY000: The MySQL server is running with the --super-read-only option so it cannot execute this statement |
| 80 |
TRUNCATE TABLE `test1`; |
| 81 |
ERROR HY000: The MySQL server is running with the --super-read-only option so it cannot execute this statement |
| 82 |
TRUNCATE TABLE `test1`; |
| 83 |
ERROR HY000: The MySQL server is running with the --super-read-only option so it cannot execute this statement |
| 84 |
|
| 85 |
## CHECK IF TABLE test1 IS IT PRESENT ON ALL SERVERS |
| 86 |
[connection new primary] |
| 87 |
SELECT * FROM test1; |
| 88 |
id name |
| 89 |
1 First ROW |
| 90 |
2 Second ROW |
| 91 |
3 Third ROW |
| 92 |
4 Second ROW |
| 93 |
5 Second ROW |
| 94 |
6 3 query |
| 95 |
7 3 query |
| 96 |
8 First ROW created in fourth query |
| 97 |
9 Second ROW created in fourth query |
| 98 |
include/diff_tables.inc [server1:test1, server2:test1] |
| 99 |
include/diff_tables.inc [server1:test1, server3:test1] |
| 100 |
include/diff_tables.inc [server1:test1, server4:test1] |
| 101 |
|
| 102 |
## CHECK TABLE test2-4, THEY SHOULDN'T BE THERE |
| 103 |
include/assert.inc ['Number of tables in current schema should be equal 1, it should be only "test1" table'] |
| 104 |
include/assert.inc ['Number of tables in current schema should be equal 1, it should be only "test1" table'] |
| 105 |
include/assert.inc ['Number of tables in current schema should be equal 1, it should be only "test1" table'] |
| 106 |
include/assert.inc ['Number of tables in current schema should be equal 1, it should be only "test1" table'] |
| 107 |
|
| 108 |
## CLEANUP |
| 109 |
DROP TABLE `test1`; |
| 110 |
include/rpl_sync.inc |
| 111 |
include/group_replication_end.inc |