Replication Set up

  • 6 Masters and their respective Slave.
  • All 6 slaves writing to a Master - which has its own Slave.

Now, I want to purge binary logs on the 6 original masters and set expiry to 15 days. Currently, those servers are holding binlogs for over 6 months.

If I just go and purge binary logs on the 6 Masters, can it be a problem for the Slaves?

Replication Topology

M Con 1 is the slave replicating from all 6 slaves (which are acting as masters).

Replication Topology

  • Either you have a weird topology, or there is a terminology problem. Slaves don't write to Masters. "Relay" servers are Slaved to a Master and Master to other Slave(s). expire_logs_days applies to binlogs (if it is a Master or Relay), but not to "relay logs" (if it is a Slave or Relay). Please clarify the topology.
    – Rick James
    Commented Dec 1, 2017 at 22:57
  • @RickJames - Slaves do write to Masters in a Daisy Chain Replication arrangement. The slaves are acting Masters for a consolidated slave. Commented Dec 1, 2017 at 23:05
  • 1
    "6 Masters and their respective Slave" -- Is that 1 Slave or 6? Please provide a diagram.
    – Rick James
    Commented Dec 1, 2017 at 23:21
  • @RickJames - My problem was solved. But do you think this is a weird topology to have? I'm sure people use this topology. Commented Dec 2, 2017 at 12:53

2 Answers 2


It's ok to purge binlog on M 01 ~ M 06 as long as S 01 ~ S 06 has relayed all the binlog you want to purge, but remember to purge slowly, for example each time purge 20 binlogs (depends on your single binlog file size and the server load)

  • 1
    Already did that and it worked out perfectly fine. Again, as long as the master binlogs have been relayed and the slave has executed them, it shouldn't at all be an issue. I purged about 100 GB in binlogs from each of the masters in one go. Probably it did not cause a problem because the machine was pretty powerful. But I agree with you on that point. Commented Dec 2, 2017 at 12:52
  • 2
    Some OSs are slow to delete gigabyte files -- this is a load on the system that Sherry may be referring to.
    – Rick James
    Commented Dec 2, 2017 at 15:26

Purging Binlog on master is independent i.e You need to add the tag expire-logs-days=Number of days on all master and all slaves my.cnf file to purge the Binlogs on both master and slave, If you only add the tag on the master it will only purge the master Binlog and not of the slaves.

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.