主从都需要配置,启用插件
install plugin rpl_semi_sync_master soname 'semisync_master.so';
install plugin rpl_semi_sync_slave soname 'semisync_slave.so';
show plugins;
主库
show variables like '%semi%';
set global rpl_semi_sync_master_enabled=1;
超时后会退化到异步复制
set global rpl_semi_sync_master_timeout=2147483648;
show variables like '%semi%';
从库
set global rpl_semi_sync_slave_enabled=1;
show variables like '%semi%';
stop slave io_thread;start slave io_thread;
主从库验证
主库
show global status like '%semi%'
| Rpl_semi_sync_master_clients | 1 |
| Rpl_semi_sync_master_status | ON |
| Rpl_semi_sync_slave_status | OFF |
show variables like '%semi%'; 默认是after_sync
从库
show global status like '%semi%'
| Rpl_semi_sync_slave_status | ON |
网友评论