doc:appunti:linux:sa:mysql_replica_master_master
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
doc:appunti:linux:sa:mysql_replica_master_master [2011/09/08 12:51] – [MySQL replica master-master] niccolo | doc:appunti:linux:sa:mysql_replica_master_master [2019/09/30 09:51] (current) – [Configurare la replica master-master] niccolo | ||
---|---|---|---|
Line 6: | Line 6: | ||
* **[[http:// | * **[[http:// | ||
- | ===== Configurare la replica master-master | + | ===== Configurare la replica master-master ===== |
+ | |||
+ | Con questa configurazione si tiene replicato **un solo database**. | ||
< | < | ||
Line 46: | Line 48: | ||
# Vedere la man page di my.cnf, che non esiste. | # Vedere la man page di my.cnf, che non esiste. | ||
/ | / | ||
+ | </ | ||
+ | |||
+ | Per vedere se si sono assegnati i permessi di replica: | ||
+ | |||
+ | < | ||
+ | SHOW GRANTS FOR ' | ||
+ | </ | ||
+ | |||
+ | Ovviamente è opportuno concedere i grant non dall' | ||
+ | ===== Sincronizzare il db ===== | ||
+ | |||
+ | < | ||
+ | -- Su server1 | ||
+ | USE exampledb; | ||
+ | FLUSH TABLES WITH READ LOCK; | ||
+ | SHOW MASTER STATUS; | ||
+ | -- Prendere nota dello status. | ||
+ | -- Fare un dump e copiarlo sull' | ||
+ | UNLOCK TABLES; | ||
+ | |||
+ | -- Su server2 | ||
+ | -- mysqladmin --user=root --password stop-slave | ||
+ | CREATE DATABASE exampledb; | ||
+ | -- mysql -u root -p exampledb < exampledb.sql | ||
+ | USE exampledb; | ||
+ | FLUSH TABLES WITH READ LOCK; | ||
+ | SHOW MASTER STATUS; | ||
+ | -- Prendere nota dello status. | ||
+ | UNLOCK TABLES; | ||
+ | CHANGE MASTER TO MASTER_HOST=' | ||
+ | MASTER_PASSWORD=' | ||
+ | MASTER_LOG_POS=106; | ||
+ | START SLAVE; | ||
+ | SHOW SLAVE STATUS; | ||
+ | |||
+ | -- Su server1 | ||
+ | STOP SLAVE; | ||
+ | CHANGE MASTER TO MASTER_HOST=' | ||
+ | MASTER_PASSWORD=' | ||
+ | MASTER_LOG_POS=2359; | ||
+ | START SLAVE; | ||
+ | SHOW SLAVE STATUS; | ||
</ | </ | ||
===== Crash test ===== | ===== Crash test ===== |
doc/appunti/linux/sa/mysql_replica_master_master.txt · Last modified: 2019/09/30 09:51 by niccolo