9.开启半同步复制 主上 INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master.so'; SET GLOBAL rpl_semi_sync_master_enabled=ON; SHOW GLOBAL VARIABLES LIKE 'rpl_semi%';
| rpl_semi_sync_master_enabled | ON | | rpl_semi_sync_master_timeout | 10000 | | rpl_semi_sync_master_trace_level | 32 | | rpl_semi_sync_master_wait_no_slave | ON | +------------------------------------+-------+ 从上 INSTALL PLUGIN rpl_semi_sync_slave SONAME 'semisync_slave.so'; MariaDB [mydb]> STOP SLAVE IO_THREAD; MariaDB [mydb]> SET GLOBAL rpl_semi_sync_slave_enabled = ON ; MariaDB [mydb]> START SLAVE ; MariaDB [mydb]> SHOW GLOBAL VARIABLES LIKE 'rpl_semi%'; 查看是否生效 Tail -200 /var/log/mariadb/mariadb.log,有以下记录则生效 mysql主从复制笔记