Reset replica of multi-master
0
votes
0
answers
60
views
We have a master-master binlog replication using MySQL 8.0 where only master1 is written to by the application and master2 is pretty much a hot standby. I had a replica of master2 where that server failed and I need to recreate the replica, where I do backups. Only one database was being replicated that includes innodb and a fairly large 40+ million record myisam table.
Must I do a
reset master
on the master2
server to recreate the replica? Just the commands below before I dump the database to be replicated and UNLOCK TABLES
...
root@localhost [(none)]> FLUSH TABLES WITH READ LOCK;
root@localhost [(none)]> SHOW MASTER STATUS;
If the RESET MASTER
is required first, I would also need to STOP REPLICA
on master1
first? Or should I use the --master-data
option with mysaqldump
instead.
Also, master1
and master2
replicate all databases where the replica only replicates one database, is that ok? Seems to work when I setup initially. But is it safer to replicate all databases on the replica as well? I want to use the replica server for other databases.
Asked by rwfitzy
(101 rep)
Aug 17, 2024, 08:35 PM