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:52] – [Configurare la replica master-master (su un solo database)] niccolo | doc:appunti:linux:sa:mysql_replica_master_master [2025/03/12 15:03] (current) – [Verifica dello stato SLAVE] niccolo | ||
---|---|---|---|
Line 50: | Line 50: | ||
</ | </ | ||
+ | Per vedere se si sono assegnati i permessi di replica: | ||
+ | |||
+ | < | ||
+ | SHOW GRANTS FOR ' | ||
+ | </ | ||
+ | |||
+ | Ovviamente è opportuno concedere i grant non dall' | ||
===== Sincronizzare il db ===== | ===== Sincronizzare il db ===== | ||
< | < | ||
-- 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=' | + | CHANGE MASTER TO MASTER_HOST=' |
- | ', 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=' | + | CHANGE MASTER TO MASTER_HOST=' |
+ | | ||
+ | | ||
START SLAVE; | START SLAVE; | ||
SHOW SLAVE STATUS; | SHOW SLAVE STATUS; | ||
</ | </ | ||
+ | ===== Verifica dello stato SLAVE ===== | ||
+ | |||
+ | Come utente Unix root ci si collega al database MASTER/ | ||
+ | |||
+ | < | ||
+ | mysql dbname | ||
+ | </ | ||
+ | |||
+ | Per vedere lo stato di slave: | ||
+ | |||
+ | <code sql> | ||
+ | SHOW STATUS LIKE ' | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | +---------------+-------+ | ||
+ | | Variable_name | Value | | ||
+ | +---------------+-------+ | ||
+ | | Slave_running | ON | | ||
+ | +---------------+-------+ | ||
+ | </ | ||
+ | |||
+ | Per verificare lo stato di slave e in particolare il numero di log in corso di replica (**Relay_Master_Log_File**): | ||
+ | |||
+ | <code sql> | ||
+ | SHOW SLAVE STATUS\G; | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | MariaDB [dbname]> | ||
+ | *************************** 1. row *************************** | ||
+ | | ||
+ | Master_Host: | ||
+ | Master_User: | ||
+ | Master_Port: | ||
+ | Connect_Retry: | ||
+ | Master_Log_File: | ||
+ | Read_Master_Log_Pos: | ||
+ | | ||
+ | Relay_Log_Pos: | ||
+ | Relay_Master_Log_File: | ||
+ | | ||
+ | Slave_SQL_Running: | ||
+ | Replicate_Do_DB: | ||
+ | Replicate_Ignore_DB: | ||
+ | | ||
+ | | ||
+ | Replicate_Wild_Do_Table: | ||
+ | Replicate_Wild_Ignore_Table: | ||
+ | | ||
+ | | ||
+ | | ||
+ | Exec_Master_Log_Pos: | ||
+ | Relay_Log_Space: | ||
+ | Until_Condition: | ||
+ | | ||
+ | Until_Log_Pos: | ||
+ | | ||
+ | | ||
+ | | ||
+ | Master_SSL_Cert: | ||
+ | Master_SSL_Cipher: | ||
+ | | ||
+ | Seconds_Behind_Master: | ||
+ | Master_SSL_Verify_Server_Cert: | ||
+ | Last_IO_Errno: | ||
+ | Last_IO_Error: | ||
+ | | ||
+ | | ||
+ | Replicate_Ignore_Server_Ids: | ||
+ | | ||
+ | </ | ||
+ | |||
+ | Se **durante la sincronizzazione uno statement fallisce** si vede l' | ||
+ | |||
+ | <code sql> | ||
+ | STOP SLAVE; | ||
+ | SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; | ||
+ | START SLAVE; | ||
+ | </ | ||
+ | |||
===== Crash test ===== | ===== Crash test ===== | ||
doc/appunti/linux/sa/mysql_replica_master_master.1315479176.txt.gz · Last modified: 2011/09/08 12:52 by niccolo