Recently, Oracle released several new features in the latest MySQL 5.7.2 version. Most of the improvements are in terms of database performance and replication-related features. This new version will bring us incredible results.
In this article, I will try to understand the working principle of this new multi-source replication and how we can perform our own tests with some simple steps. It should be noted that this is a development version, not for the production environment. Therefore, this article is intended for those who want to learn about this new feature to see how it works in the application, all of which are related operations in the temporary environment.
What is multi-source replication?
First, we need to know that multi-master and multi-source replication are not the same. Multi-Master replication is generally a circular replication. You can copy data to other hosts on any host.
Multi-source is different. mySQL fixes a replication restriction in this new version, which means that only one master site can be used for one slave site. this is a limiting factor in our design replication environment, and some geeks make it work normally. But now there is an official solution. So. To put it simply, Multi-Source means that a slave station can have more than one master station. Now, it is possible to have the same replication environment:
This will help us create some replication hierarchies, which was impossible in the past. For example, you can place a slave station in your office. Copy data from all the main sites in the office and spread it all over the world.
How does it work?
Now we have the concept of a communication channel. Every communication channel is a link that gets binary logs from the master server from the server. This means that each communication channel has an IO_THREAD. We need to run different "change master" commands for each MASTER server. We need to use the "for channel" parameter to provide the name of the communication link.
Change master MASTER_HOST = 'something', MASTER_USER =... for channel = "name_of_channel ";
It's easy. There is a single prerequisite. The slave server needs to configure the security function on mysql5.6, which means the information is usually contained on the master server. Information or logs should be in a table. Let's get started with configuration.
For more details, please continue to read the highlights on the next page:
Recommended reading:
Load Nginx in Ubuntu for high-performance WEB Server 5 --- MySQL master/Master Synchronization
Production Environment MySQL master/Master synchronization primary key conflict handling
MySQL Master/Slave failure error Got fatal error 1236
MySQL master-slave replication, implemented on a single server