patternsqlMinor
Is binary logs required on the slave in order to do replication?
Viewed 0 times
theorderlogsslavereplicationbinaryrequired
Problem
I have a MySQL database setup with a master and a slave. As far as I understand, the master writes transaction events to a binary log, which is read and executed by the slave, thus making the slave a continuous copy of the master.
I was under the impression that I needed to make sure that the slave had consumed a specific binary log file before I could safely purge it. But now I have read documents indicating that the binary log isn't really used by the slave in order to facilitate replication. It is instead the relay log which is of interest on the slave. The binary log is only interesting to keep if I need to do point-in-time restores. Is this correct?
If correct, does this mean that I can either turn off binary logs on the slave or purge them all at any time?
I was under the impression that I needed to make sure that the slave had consumed a specific binary log file before I could safely purge it. But now I have read documents indicating that the binary log isn't really used by the slave in order to facilitate replication. It is instead the relay log which is of interest on the slave. The binary log is only interesting to keep if I need to do point-in-time restores. Is this correct?
If correct, does this mean that I can either turn off binary logs on the slave or purge them all at any time?
Solution
This is correct:
Therefore, for replication purposes, slave's binary files are not needed.
And, yes, you can disable binary logging or purge these files if not needed for other purposes like "backup".
- The master writes to its "binary log" files
- The slave reads its master's binary files and write them to its "relay log" files
- The slave executes the statements in its "relay log" files.
Therefore, for replication purposes, slave's binary files are not needed.
And, yes, you can disable binary logging or purge these files if not needed for other purposes like "backup".
Context
StackExchange Database Administrators Q#115247, answer score: 7
Revisions (0)
No revisions yet.