Starting with version 5.6, you can use the Mysqlbinlog command to back up logs from a remote machine to a local directory, making it easier and faster to implement a Binlog server.
Environment Description: 192.168.56.100 is a backup server, 192.168.56.101 is a MySQL server that needs to be backed up binlog.
Key parameter Introduction:
The-r,--read-from-remote-server represents the read binlog from the remote MySQL server.
-raw stores logs in binlog format for later use.
The--stop-never connects to the remote MySQL server to read the log until the remote service shuts down, or is killed.
mysql-bin.*** represents the log from which to start the backup.
--stop-never-slave-server-id Mysqlbinlog is equivalent to the log from the main library, all need to Server-id to make a unique identity.
The operation is as follows:
Now 56.100 Create a binlog backup directory:
Mkdir-p/data/binlogbak
Perform remote replication Binlog command on 56.100 and start backup from mysql-binlog.00008
Mysqlbinlog--raw--read-from-remote-server--stop-never--host=192.168.56.101--port=3306--user=root--password=A a123456 mysql-binlog.00008
MySQL Binlog Server