MySQL Master-slave configuration
- MySQL Master-Slave introduction
- Preparatory work
- Configure the Primary
- Configuration from
- Test Master-Slave synchronization
MySQL Master-Slave introduction
MySQL master-slave is also called replication, AB replication. Simply speaking is a and b two machines from the back, write the data on a, the other B will follow the writing data, both data in real-time synchronization.
MySQL master-slave is based on Binlog, the Lord must open Binlog to carry out master and slave.
The master-slave process has a roughly 3-step
- The change operation is recorded in Binlog.
- From synchronizing the main binlog event (SQL statement) to the native and recording in Relaylog
- Execute sequentially from the SQL statements inside the Relaylog
The Lord has a log dump thread that is used to communicate with the I/O thread from Binglog
There are two threads from the top, where I/O threads are used to synchronize the main binlog and generate Relaylog, and another SQL thread is used to put the SQL statements inside the Relaylog
Ready to work (build MySQL on two machines)
MySQL Installation
MySQL Master-slave configuration