Semi-synchronous
1. Main service
mysql > Install plugin rpl_semi_sync_master soname ' semisync_master.so '; # Turn on the main service semi-sync function
MySQL > Show global variables like '%semi% '; #查看半同步开启状态信息
MySQL > Set global rpl_semi_sync_master_enabled=on; Turn on semi-synchronous replication
MySQL > Set global rpl_semi_sync_master_timeout=10000; Set to 10 seconds 10000ms milliseconds =10 seconds 1000ms milliseconds = 1 seconds
or add in [mysqld]
rpl_semi_sync_master_enabled = 1
Rpl_semi_sync_master_timeout = 10000
2. From the service
mysql > Install plugin rpl_semi_sync_slave soname ' semisync_slave.so '; # turn on slave half sync function
To set the replication of global variables from the server semi-synchronous
MySQL > Set global rpl_semi_sync_slave_enabled=on; Turn on semi-synchronous replication
or add in [mysqld]
rpl_semi_sync_slave_enabled = 1
mysql > Stop slave io_thread; Close IO Thread
mysql > Start slave io_thread; Open IO Thread
3. View primary, slave server status
MySQL > Show global status Like '%semi% ';
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/71/B0/wKioL1XW6j3QlektAAIxF9c_VA4493.jpg "title=" 1.png " alt= "Wkiol1xw6j3qlektaaixf9c_va4493.jpg"/>
(Note: The red position of the first display by the number of clients 1, the second display on it became)
4. View global Variables
MySQL > Show global variables like '%semi% ';
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/71/B4/wKiom1XW6KKBFarYAAFLjtB9iuA004.jpg "title=" 2.png " alt= "Wkiom1xw6kkbfaryaafljtb9iua004.jpg"/>
View Binlong Logs
SHOW BINLOG EVENTS in ' mysql-bin.000002 ';
There will be information you want.
This is the end!
This article from "SQL" blog, declined reprint!
mysql-Semi-synchronous