Replication Coordinates
Replication Coordinates
Replication Coordinates
coordinates
Apr 15, 2018
Basic MySQL replication (as implemented in MySQL 5.5) conceptually is very simple -
master server use binlog dump thread to write data changes (row based, statement
based or mixed depending on settings) into binary log and slave use I/O thread to
copy statements from binay log into relay log. Another slave thread - SQL thread -
reads data from relay log and applies them (so that changes made in master server
would appear in slave server too). This basic MySQL replication design is shown in
picture bellow.
SHOW SLAVE STATUS is main command in order to check state of MySQL replication
as it shows information about slave threads and other parameters. Here is example
from actual running slave server (information not related with slave threads is not
shown) with explanation:
Picture below shows graphical representation how these parameters fits into basic
MySQL replication setup.
These 6 parameters logically can be grouped into three tuples (filename, position)
and these 3 pairs gives us nice overview of slave threads progress:
Just add a note for PURGE BINARY LOGS;, this is a pretty safe command according to
official document : This statement is safe to run while slaves are replicating. You need
not stop them. If you have an active slave that currently is reading one of the log files
you are trying to delete, this statement does nothing and fails with an error.