Because the server data is more important, in addition to the configuration of a master three from the mode, but also increased the main library Binlog real-time backup.
Binlog basic definition: A binary log that records SQL statements that occur to or potentially change data and is stored in a binary form on disk.
configuration Modify my.cnf parameter file join
Log-bin =/database/mysql/logs/binlog/mysql-bin indicates that the archive log is turned on. Additional parameters for Binlog can be found in the previous MySQL general optimization configuration.
Entering Mysqlbinlog--help under CentOS will display all the parameters of the Mysqlbinlog tool. Note that the mysqlbinlog I'm talking about here is the tool that tools open the archive log, not the Binlogs log file below.
Install the mysql5.6 version of Mysqlbinlog on the client (backup server). The Yum source configuration mysql5.6 can be installed directly and given replication permissions.
The following is my simple test script, of course, network server on the Internet for other reasons, such as the exception can be added, time-out breakpoint continued transmission and so on.
#!/bin/bash
Mysqlbinlog--read-from-remote-server--host=192.168.0.200--port=3306--user= "Log_master"--password= "Binlgobak"-- Raw--stop-never--result-file=/data/masterlogbackup mysql-bin.000001
The mysqlbinlog automatically synchronizes the Binlog log files from the original main library, and when a new log file is generated with flush logs, the Mysqlbinlog process on the backup server is automatically tracked and a new Binlog file is automatically generated. Wow, it feels so strong. There is wood there!!!
Xiaoye of mysql5.6 Binlog Real-time offsite backup