Preparation environment:
OS Version:centos Release 6.5 (Final)
Server information:
master1:192.168.1.29
master2:192.168.1.37
slave:192.168.1.86
1, modify MY.CNF
Slave in the my.cnf add the following parameters
Enable enhanced multi-threaded slave (multithreaded replication)
Slave-parallel-type=logical_clock
Slave-parallel-workers=8
master_info_repository=
TABL
relay_log_info_repository=
table
relay_log_recovery=
ON
Parallel replication can be done through the following monitoring
Mysql> Show tables like ' replication% ';
+---------------------------------------------+
| Tables_in_performance_schema (replication%) |
+---------------------------------------------+
| replication_applier_configuration |
| Replication_applier_status |
| Replication_applier_status_by_coordinator |
| Replication_applier_status_by_worker |
| replication_connection_configuration |
| Replication_connection_status |
| Replication_group_member_stats |
| Replication_group_members |
+----------------------------------
2, authorized, authorized on Master1 and Master2, allow slave copy
3,change Master
Change Master tomaster_host= "192.168.1.29", master_port=3306,master_user= "root", master_password= "[email protected] "For CHANNEL" Master1 ";
Change Master tomaster_host= "192.168.1.37", master_port=3306,master_user= "root", master_password= "[email protected] "For CHANNEL" Master2 ";
4, start slave
start slave for channel "master1";
start slave for channel "master2";
MySQL 5.7 is called true parallel replication, the main reason is that the playback of the slave server is consistent with the host, that is, how to perform parallel playback on slave on the master server. There is no longer a parallel replication limit for libraries and there is no special requirement for binary log formats (library-based parallel replication is not required).
from the MySQL official point of view, its original plan for parallel replication is to support table-level parallel replication and row-level parallel replication, row-level parallel replication by parsing the row format of the binary log to complete the way, wl#4648 . But the final show to the small partner is indeed in the development plan called: mts:prepared transactions slave parallel applier, visible:wl#6314. The idea of parallel replication was first proposed by MARIADB's Kristain, and has appeared in Mariadb 10, believing that many of the features chosen by MARIADB are one of the most important functions of parallel replication.
This article is from the "I am a Little bird" blog, please make sure to keep this source http://2242558.blog.51cto.com/2232558/1709694
Mysql 5.7 Multi-source replication and parallel replication capabilities