E
E
entermix2018-06-13 14:06:54
MySQL
entermix, 2018-06-13 14:06:54

How to restore replication after slave relay logs are corrupted?

There are 2 servers, master-master replication is configured on both. Now replication is broken on one of the servers (slave relay logs are damaged), the following actions usually help:

mysql> show slave status
mysql> stop slave;
mysql> reset slave;
mysql> change master to master_log_file='mysql-bin.***', master_log_pos=***;
mysql> start slave;

But what if the reset slave command was issued, but the show slave status command was omitted before it, and now the values ​​of master_log_file and master_log_pos are unknown?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
entermix, 2018-06-13
@entermix

1. Open the MySQL log /var/log/mariadb/mariadb.log
2. Look for the last entry that contains the necessary information,
3. Follow the instructions:

mysql> change master to master_log_file='mysql-bin.***', master_log_pos=***;
mysql> start slave;
...

R
Ruslan Fedoseev, 2018-06-13
@martin74ua

stop the live master, remove the dump, reset the muscle logs, start the master, deploy the backup on the slave, start the slave.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question