0

I am currently working to get GTID based replication established between mySQL 5.7.33 on 2 servers. Amidst this work, I ran into a disk space issue and purged the binary logs on the master.

Now I have run into the problem where I cannot get the replication started due to the missing binary logs.

What can I do, without the bin logs, to get replication going?

Thanks for any advice!

1
  • Start over, I guess.
    – mustaccio
    Commented Apr 7, 2021 at 1:46

1 Answer 1

2

Whether you use GTID or not, any replica needs a continuous stream of binlogs to keep in sync.

If any of the binlogs needed for the replica to catch up are gone, then it's trash. It can never catch up.

You need to reinitialize the replica. As if you were creating a new replica: make a new backup from the master, and use it to overwrite the replica. Then the replica can catch up from the point you created the backup.

2
  • I am fine with reinitializing the replica. Can I do this from a mysqldump backup? Do I need to set the master pos after the backup? Thank you for the guidance - I am a programmer and not a DBA, as you can probably tell by my deletion of the bin logs in the first place. Commented Apr 7, 2021 at 1:25
  • A bit late on answer, you probably solved this already but for others. Yes after you recreate the database via mysqldump on slave then restart replication it should pick up the new entries as the master database will have moved on and the GTIDs on the replica will be behind and replication will try to catch up. Commented Jul 28, 2021 at 16:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.