7. Types of Replication
● STATEMENT
UPDATE t1 SET count=100 WHERE id=100;UPDATE t1 SET count=100 WHERE id=100;
INSERT INTO t1 VALUES (102, 1);INSERT INTO t1 VALUES (102, 1);
8. Types of Replication
● ROW
table t1 change:table t1 change:
ROW id=100 count=100ROW id=100 count=100
table t1 change:table t1 change:
add row with id=102, count=1add row with id=102, count=1
9. Types of Replication
● MIXED
UPDATE t1 SET count=100 WHERE id=100;UPDATE t1 SET count=100 WHERE id=100;
table t1 change:table t1 change:
ROW id=100 count=100ROW id=100 count=100
INSERT INTO t1 VALUES (102, 1);INSERT INTO t1 VALUES (102, 1);
table t1 change:table t1 change:
add row with id=102, count=1add row with id=102, count=1
10. What is Galera
●
Write set replication - WSREPWrite set replication - WSREP
●
Global Transaction ID - GTIDGlobal Transaction ID - GTID
11. What is Galera
●
Write set replication - WSREPWrite set replication - WSREP
UPDATE t1 SET count=100 WHERE id=100;UPDATE t1 SET count=100 WHERE id=100;
INSERT INTO t1 VALUES (102, 1);INSERT INTO t1 VALUES (102, 1);
Write setWrite set
12. What is Galera
●
Write set replication - WSREPWrite set replication - WSREP
UPDATE t1 SET count=100 WHERE id=100;UPDATE t1 SET count=100 WHERE id=100;
INSERT INTO t1 VALUES (102, 1);INSERT INTO t1 VALUES (102, 1);
Write setWrite set
GTID: 318e70bb-4ba2-4707-aa5f-20cf44c3d367GTID: 318e70bb-4ba2-4707-aa5f-20cf44c3d367
13. What is Galera
●
Write set replication - WSREPWrite set replication - WSREP
UPDATE t1 SET count=100 WHERE id=100;UPDATE t1 SET count=100 WHERE id=100;
INSERT INTO t1 VALUES (102, 1);INSERT INTO t1 VALUES (102, 1);
Write setWrite set
GTID: 318e70bb-4ba2-4707-aa5f-20cf44c3d367GTID: 318e70bb-4ba2-4707-aa5f-20cf44c3d367
Certification based replication???Certification based replication???
14. ● WSREP XXX-XXX
– certificate that it can proceed
– check based on table's primary key
28. Adding new node
● Add GRANTs for the new machine
– GRANT ALL ON *.* TO 'root'@'10.19.1.10' IDENTIFIED BY 'ensurethehighest';
● Copy the my.cnf from another node
● Fix the node_name and node_address
● Add the IP of the local node to cluster_address
● Start MySQL on the new node
● After the sync is done and the new node is in the cluster
– update the cluster_address in the configuration of the other nodes
– update the cluster_address in the running mysql instances:
mysql> set global wsrep_cluster_address =
'gcomm://10.19.1.8,10.19.1.9,10.19.1.10';