Situation: 2 servers running in master - master replication, working fine.
For some reason, in my application (error case), I need to backup the database on server 1 and restire it on server 2. 2 tables in the database are set to
NOT replicate in ini file ('replicate-wild-ignore-table=%.table1' and 'replicate-wild-ignore-table=%.table2'
Procedure (all commands are issued from server 1)
1. stop replication on on server 1 (stop slave)
2. stop replication on on server 2 (stop slave)
After this, both 'Slave_IO_Running' and 'Slave_SQL_Running' are 'NO' on both servers
3. Drop database schema on server 2
4. Backup database on server 1
5. Restore database on server 2 (takes a while)
6. Reset replication on both servers (STOP SLAVE; FLUSH TABLES WITH READ LOCK; RESET SLAVE ALL; RESET MASTER; UNLOCK TABLES)
7. Get Master status on server 1
8. set master params on server 2
9. start replication on server 1
10. start replication on server 2
When running this scenario, I see following things:
1. It works and all is well
2. On server 1, when running scenario, I see, in Workbench (refreshing schema's all the time), the database disappearing and coming back but the 2 not replicated tables are gone
3. On server 1, when running scenario, I see, in Workbench (refreshing schema's all the time), the database disappearing and never coming back!
In cases 2 and 3 I'm screwed because my mother database is corrupted!
Questions:
1. Is this the correct approach to replace a database on one of the servers in a master/master replication setup?
2. I can not understand/figure out why the database is disappearing on server 1 while I'm sure the database is being restored on server 2 AND according to me replication is off line.
Please help, any tip can help!
For some reason, in my application (error case), I need to backup the database on server 1 and restire it on server 2. 2 tables in the database are set to
NOT replicate in ini file ('replicate-wild-ignore-table=%.table1' and 'replicate-wild-ignore-table=%.table2'
Procedure (all commands are issued from server 1)
1. stop replication on on server 1 (stop slave)
2. stop replication on on server 2 (stop slave)
After this, both 'Slave_IO_Running' and 'Slave_SQL_Running' are 'NO' on both servers
3. Drop database schema on server 2
4. Backup database on server 1
5. Restore database on server 2 (takes a while)
6. Reset replication on both servers (STOP SLAVE; FLUSH TABLES WITH READ LOCK; RESET SLAVE ALL; RESET MASTER; UNLOCK TABLES)
7. Get Master status on server 1
8. set master params on server 2
9. start replication on server 1
10. start replication on server 2
When running this scenario, I see following things:
1. It works and all is well
2. On server 1, when running scenario, I see, in Workbench (refreshing schema's all the time), the database disappearing and coming back but the 2 not replicated tables are gone
3. On server 1, when running scenario, I see, in Workbench (refreshing schema's all the time), the database disappearing and never coming back!
In cases 2 and 3 I'm screwed because my mother database is corrupted!
Questions:
1. Is this the correct approach to replace a database on one of the servers in a master/master replication setup?
2. I can not understand/figure out why the database is disappearing on server 1 while I'm sure the database is being restored on server 2 AND according to me replication is off line.
Please help, any tip can help!