User Tools

Site Tools


doc:appunti:linux:sa:mysql_replica_master_master

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
doc:appunti:linux:sa:mysql_replica_master_master [2011/09/08 12:52] – [Configurare la replica master-master (su un solo database)] niccolodoc:appunti:linux:sa:mysql_replica_master_master [2019/09/30 09:51] (current) – [Configurare la replica master-master] niccolo
Line 50: Line 50:
 </code> </code>
  
 +Per vedere se si sono assegnati i permessi di replica:
 +
 +<code>
 +SHOW GRANTS FOR 'slave2_user'@'%';
 +</code>
 +
 +Ovviamente è opportuno concedere i grant non dall'indirizzo IP wildcard **%%%%%**, ma al singolo utente/indirizzo, del tipo **%%'replication'@'116.213.177.13'%%**.
 ===== Sincronizzare il db ===== ===== Sincronizzare il db =====
  
 <code> <code>
 -- Su server1 -- Su server1
- 
 USE exampledb; USE exampledb;
 FLUSH TABLES WITH READ LOCK; FLUSH TABLES WITH READ LOCK;
Line 71: Line 77:
 -- Prendere nota dello status. -- Prendere nota dello status.
 UNLOCK TABLES; UNLOCK TABLES;
-CHANGE MASTER TO MASTER_HOST='192.168.3.71', MASTER_USER='slave2_user', MASTER_PASSWORD='slave2_password', MASTER_LOG_FILE='mysql-bin.000001 +CHANGE MASTER TO MASTER_HOST='192.168.3.71', MASTER_USER='slave2_user', 
-', MASTER_LOG_POS=106;+    MASTER_PASSWORD='slave2_password', MASTER_LOG_FILE='mysql-bin.000001', 
 +    MASTER_LOG_POS=106;
 START SLAVE; START SLAVE;
 SHOW SLAVE STATUS; SHOW SLAVE STATUS;
Line 78: Line 85:
 -- Su server1 -- Su server1
 STOP SLAVE; STOP SLAVE;
-CHANGE MASTER TO MASTER_HOST='192.168.3.73', MASTER_USER='slave1_user', MASTER_PASSWORD='slave1_password', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=2359;+CHANGE MASTER TO MASTER_HOST='192.168.3.73', MASTER_USER='slave1_user', 
 +    MASTER_PASSWORD='slave1_password', MASTER_LOG_FILE='mysql-bin.000001', 
 +    MASTER_LOG_POS=2359;
 START SLAVE; START SLAVE;
 SHOW SLAVE STATUS; SHOW SLAVE STATUS;
doc/appunti/linux/sa/mysql_replica_master_master.1315479176.txt.gz · Last modified: 2011/09/08 12:52 by niccolo