Mysql – Purging Binary Logs from Master in a Replication Environment

binlogdisk-spaceMySQLreplication

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

Best Answer

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)