we've know the machenism of semi-synchronous replication in my previous article,let's do some test to learn more details about it.now i have three virtual machines in my test environment,one master and the other two slaves are replicated from master which based on GTID mode.the replication method is asynchronous at the moment.okay here we go.

 .Install the plugin of semi-synchronous replication on master.
root@localhost:mysql3306.sock [(none)]::>INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master.so';
Query OK, rows affected (0.11 sec) root@localhost:mysql3306.sock [(none)]::>SELECT PLUGIN_NAME, PLUGIN_STATUS
-> FROM INFORMATION_SCHEMA.PLUGINS
-> WHERE PLUGIN_NAME LIKE '%semi%';
+----------------------+---------------+
| PLUGIN_NAME | PLUGIN_STATUS |
+----------------------+---------------+
| rpl_semi_sync_master | ACTIVE |
+----------------------+---------------+
row in set (0.00 sec) root@localhost:mysql3306.sock [(none)]::>show plugins;
+----------------------------+----------+--------------------+--------------------+---------+
| Name | Status | Type | Library | License |
+----------------------------+----------+--------------------+--------------------+---------+
| binlog | ACTIVE | STORAGE ENGINE | NULL | GPL |
| mysql_native_password | ACTIVE | AUTHENTICATION | NULL | GPL |
| sha256_password | ACTIVE | AUTHENTICATION | NULL | GPL |
| PERFORMANCE_SCHEMA | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MRG_MYISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MEMORY | ACTIVE | STORAGE ENGINE | NULL | GPL |
| InnoDB | ACTIVE | STORAGE ENGINE | NULL | GPL |
| INNODB_TRX | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_LOCKS | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_LOCK_WAITS | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_CMP | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_CMP_RESET | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_CMPMEM | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_CMPMEM_RESET | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_CMP_PER_INDEX | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_CMP_PER_INDEX_RESET | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_BUFFER_PAGE | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_BUFFER_PAGE_LRU | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_BUFFER_POOL_STATS | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_TEMP_TABLE_INFO | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_METRICS | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_FT_DEFAULT_STOPWORD | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_FT_DELETED | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_FT_BEING_DELETED | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_FT_CONFIG | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_FT_INDEX_CACHE | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_FT_INDEX_TABLE | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_SYS_TABLES | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_SYS_TABLESTATS | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_SYS_INDEXES | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_SYS_COLUMNS | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_SYS_FIELDS | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_SYS_FOREIGN | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_SYS_FOREIGN_COLS | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_SYS_TABLESPACES | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_SYS_DATAFILES | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| INNODB_SYS_VIRTUAL | ACTIVE | INFORMATION SCHEMA | NULL | GPL |
| CSV | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MyISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
| ARCHIVE | ACTIVE | STORAGE ENGINE | NULL | GPL |
| partition | ACTIVE | STORAGE ENGINE | NULL | GPL |
| BLACKHOLE | ACTIVE | STORAGE ENGINE | NULL | GPL |
| FEDERATED | DISABLED | STORAGE ENGINE | NULL | GPL |
| ngram | ACTIVE | FTPARSER | NULL | GPL |
| rpl_semi_sync_master | ACTIVE | REPLICATION | semisync_master.so | GPL | -- Here you'll see plugin "rpl_semi_sync_master" has been installed
+----------------------------+----------+--------------------+--------------------+---------+
rows in set (0.00 sec) root@localhost:mysql3306.sock [(none)]::> .Install the plugin of semi-synchronous replication on slave .
root@localhost:mysql.sock [(none)]::>INSTALL PLUGIN rpl_semi_sync_slave SONAME 'semisync_slave.so';
Query OK, rows affected (0.06 sec) root@localhost:mysql.sock [(none)]::>SELECT PLUGIN_NAME, PLUGIN_STATUS
-> FROM INFORMATION_SCHEMA.PLUGINS
-> WHERE PLUGIN_NAME LIKE '%semi%';
+---------------------+---------------+
| PLUGIN_NAME | PLUGIN_STATUS |
+---------------------+---------------+
| rpl_semi_sync_slave | ACTIVE |
+---------------------+---------------+
row in set (0.00 sec) root@localhost:mysql.sock [(none)]::> .Install the plugin of semi-synchronous replication on slave .
root@localhost:mysql3306.sock [(none)]::>INSTALL PLUGIN rpl_semi_sync_slave SONAME 'semisync_slave.so';
Query OK, rows affected (0.09 sec) root@localhost:mysql3306.sock [(none)]::>SELECT PLUGIN_NAME, PLUGIN_STATUS
-> FROM INFORMATION_SCHEMA.PLUGINS
-> WHERE PLUGIN_NAME LIKE '%semi%';
+---------------------+---------------+
| PLUGIN_NAME | PLUGIN_STATUS |
+---------------------+---------------+
| rpl_semi_sync_slave | ACTIVE |
+---------------------+---------------+
row in set (0.00 sec) root@localhost:mysql3306.sock [(none)]::> .Enbale the semi-synchronous replication on master.
root@localhost:mysql3306.sock [(none)]::>SET GLOBAL rpl_semi_sync_master_enabled=; -- The parameter can be changed at runtime.
Query OK, rows affected (0.00 sec) root@localhost:mysql3306.sock [(none)]::>show global status like 'rpl%'; -- We can see all the status about semi-synchronous replication here.
+--------------------------------------------+-------+
| Variable_name | Value |
+--------------------------------------------+-------+
| Rpl_semi_sync_master_clients | |
| Rpl_semi_sync_master_net_avg_wait_time | |
| Rpl_semi_sync_master_net_wait_time | |
| Rpl_semi_sync_master_net_waits | |
| Rpl_semi_sync_master_no_times | |
| Rpl_semi_sync_master_no_tx | |
| Rpl_semi_sync_master_status | ON |
| Rpl_semi_sync_master_timefunc_failures | |
| Rpl_semi_sync_master_tx_avg_wait_time | |
| Rpl_semi_sync_master_tx_wait_time | |
| Rpl_semi_sync_master_tx_waits | |
| Rpl_semi_sync_master_wait_pos_backtraverse | |
| Rpl_semi_sync_master_wait_sessions | |
| Rpl_semi_sync_master_yes_tx | |
+--------------------------------------------+-------+
rows in set (0.00 sec) .Enbale the semi-synchronous replication on salve .
root@localhost:mysql.sock [(none)]::>SET GLOBAL rpl_semi_sync_slave_enabled=;
Query OK, rows affected (0.00 sec) root@localhost:mysql.sock [(none)]::>show global status like 'rpl%';
+----------------------------+-------+
| Variable_name | Value |
+----------------------------+-------+
| Rpl_semi_sync_slave_status | OFF | -- It's still "OFF" now,'cause the sql IO_Thread should be restart.
+----------------------------+-------+
row in set (0.00 sec) root@localhost:mysql.sock [(none)]::>stop slave io_thread;
Query OK, rows affected (0.00 sec) root@localhost:mysql.sock [(none)]::>start slave io_thread;
Query OK, rows affected (0.00 sec) root@localhost:mysql.sock [(none)]::>show global status like 'rpl%';
+----------------------------+-------+
| Variable_name | Value |
+----------------------------+-------+
| Rpl_semi_sync_slave_status | ON | -- Now,the value has become "ON"
+----------------------------+-------+
row in set (0.00 sec) root@localhost:mysql.sock [(none)]::> .Enbale the semi-synchronous replication on salve .
root@localhost:mysql3306.sock [(none)]::>SET GLOBAL rpl_semi_sync_slave_enabled=;
Query OK, rows affected (0.00 sec) root@localhost:mysql3306.sock [(none)]::>show global status like 'rpl%';
+----------------------------+-------+
| Variable_name | Value |
+----------------------------+-------+
| Rpl_semi_sync_slave_status | OFF |
+----------------------------+-------+
row in set (0.01 sec) root@localhost:mysql3306.sock [(none)]::>stop slave io_thread;
Query OK, rows affected (0.00 sec) root@localhost:mysql3306.sock [(none)]::>start slave io_thread;
Query OK, rows affected (0.00 sec) root@localhost:mysql3306.sock [(none)]::>show global status like 'rpl%';
+----------------------------+-------+
| Variable_name | Value |
+----------------------------+-------+
| Rpl_semi_sync_slave_status | ON |
+----------------------------+-------+
row in set (0.00 sec) root@localhost:mysql3306.sock [(none)]::> .check the status of master again.
root@localhost:mysql3306.sock [(none)]::>show global status like 'rpl%';
+--------------------------------------------+-------+
| Variable_name | Value |
+--------------------------------------------+-------+
| Rpl_semi_sync_master_clients | | -- This value of status will show how many slave in semi_synchronous mode you really have.
| Rpl_semi_sync_master_net_avg_wait_time | |
| Rpl_semi_sync_master_net_wait_time | |
| Rpl_semi_sync_master_net_waits | |
| Rpl_semi_sync_master_no_times | |
| Rpl_semi_sync_master_no_tx | |
| Rpl_semi_sync_master_status | ON |
| Rpl_semi_sync_master_timefunc_failures | |
| Rpl_semi_sync_master_tx_avg_wait_time | |
| Rpl_semi_sync_master_tx_wait_time | |
| Rpl_semi_sync_master_tx_waits | |
| Rpl_semi_sync_master_wait_pos_backtraverse | |
| Rpl_semi_sync_master_wait_sessions | |
| Rpl_semi_sync_master_yes_tx | |
+--------------------------------------------+-------+
rows in set (0.00 sec) root@localhost:mysql3306.sock [(none)]::> .Let's do some tests with semi-synchronous replication,create a table and insert several records on master.
root@localhost:mysql3306.sock [(none)]::>use zlm;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A Database changed
root@localhost:mysql3306.sock [zlm]::>create table semi_sync_test(
-> id int auto_increment,
-> name char() not null default '',
-> primary key(id)
-> ) engine=innodb charset=utf8;
Query OK, rows affected (0.04 sec) root@localhost:mysql3306.sock [zlm]::>insert into semi_sync_test(name) values('aaa');
Query OK, row affected (0.00 sec) root@localhost:mysql3306.sock [zlm]::>show global status like 'rpl%';
+--------------------------------------------+-------+
| Variable_name | Value |
+--------------------------------------------+-------+
| Rpl_semi_sync_master_clients | |
| Rpl_semi_sync_master_net_avg_wait_time | |
| Rpl_semi_sync_master_net_wait_time | |
| Rpl_semi_sync_master_net_waits | | -- The times of master waiting for slave replies(two slaves plus two transcations got ).
| Rpl_semi_sync_master_no_times | |
| Rpl_semi_sync_master_no_tx | |
| Rpl_semi_sync_master_status | ON |
| Rpl_semi_sync_master_timefunc_failures | |
| Rpl_semi_sync_master_tx_avg_wait_time | | -- Total avertage time master has waited for transaction.
| Rpl_semi_sync_master_tx_wait_time | | -- Total time master has waited for transaction.(two transactions plus got ).
| Rpl_semi_sync_master_tx_waits | | -- I generated two transactions just now,the figure here is ""
| Rpl_semi_sync_master_wait_pos_backtraverse | |
| Rpl_semi_sync_master_wait_sessions | |
| Rpl_semi_sync_master_yes_tx | | -- The two transactions were all acknowleged by the two slaves.
+--------------------------------------------+-------+
rows in set (0.00 sec) root@localhost:mysql3306.sock [zlm]::> here's some messages from error log: --10T12::.265030Z [Note] Semi-sync replication initialized for transactions.
--10T12::.265060Z [Note] Semi-sync replication enabled on the master.
--10T12::.265349Z [Note] Starting ack receiver thread -- There's a individual thread called "ack receiver"
--10T12::.754330Z [Note] Aborted connection to db: 'unconnected' user: 'root' host: 'localhost' (Got timeout reading communication packets)
--10T12::.658621Z [Note] While initializing dump thread for slave with UUID <27af30ca--11e8-ad7e-080027de0e0e>, found a zombie dump thread with the same UUID. Master is killing the zombie dump thread().
--10T12::.658773Z [Note] Start binlog_dump to master_thread_id() slave_server(), pos(, )
--10T12::.658797Z [Note] Start semi-sync binlog_dump to slave (server_id: ), pos(, )
--10T12::.658989Z [Note] Stop asynchronous binlog_dump to slave (server_id: )
--10T12::.294491Z [Note] While initializing dump thread for slave with UUID <e00ef9f5-6c4b-11e8--080027de0e0e>, found a zombie dump thread with the same UUID. Master is killing the zombie dump thread().
--10T12::.294611Z [Note] Start binlog_dump to master_thread_id() slave_server(), pos(, )
--10T12::.294663Z [Note] Stop asynchronous binlog_dump to slave (server_id: )
--10T12::.694773Z [Note] Start semi-sync binlog_dump to slave (server_id: ), pos(, )
--10T13::.071298Z [Note] Aborted connection to db: 'zlm' user: 'root' host: 'localhost' (Got timeout reading communication packets) my parameter about semi-synchronous replication listed below: root@localhost:mysql3306.sock [zlm]::>show variables like 'rpl%';
+-------------------------------------------+------------+
| Variable_name | Value |
+-------------------------------------------+------------+
| rpl_semi_sync_master_enabled | ON |
| rpl_semi_sync_master_timeout | | -- 10s is the default value,it's the threshold when the master will turn into async mode.
| rpl_semi_sync_master_trace_level | | -- There're 4 different value of it such as 1,16,32(default),64 of debug level.
| rpl_semi_sync_master_wait_for_slave_count | |
| rpl_semi_sync_master_wait_no_slave | ON | -- "ON" is default values,the semi-sync will continue even if the slave remain is less than the value of value of "rpl_semi_sync_master_wait_for_slave_count".
| rpl_semi_sync_master_wait_point | AFTER_SYNC | -- This values is only permitted in 5.7 or above which can guarantee consistency in replication.
| rpl_stop_slave_timeout | | -- This is the maxium and default value which means year(it seems hardly to timeout^^).
+-------------------------------------------+------------+
rows in set (0.00 sec) root@localhost:mysql3306.sock [zlm]::> Now i'm gonna to test when the semi-sync mode will turned into async mode: .set the parameter "rpl_semi_sync_master_wait_for_slave_count"= and "rpl_semi_sync_master_wait_no_slave"=OFF
root@localhost:mysql3306.sock [zlm]::>set global rpl_semi_sync_master_wait_for_slave_count=;
Query OK, rows affected (0.00 sec) root@localhost:mysql3306.sock [zlm]::>set global rpl_semi_sync_master_wait_no_slave=OFF;
Query OK, rows affected (0.00 sec) root@localhost:mysql3306.sock [zlm]::>show variables like 'rpl%';
+-------------------------------------------+------------+
| Variable_name | Value |
+-------------------------------------------+------------+
| rpl_semi_sync_master_enabled | ON |
| rpl_semi_sync_master_timeout | |
| rpl_semi_sync_master_trace_level | |
| rpl_semi_sync_master_wait_for_slave_count | |
| rpl_semi_sync_master_wait_no_slave | OFF |
| rpl_semi_sync_master_wait_point | AFTER_SYNC |
| rpl_stop_slave_timeout | |
+-------------------------------------------+------------+
rows in set (0.00 sec) root@localhost:mysql3306.sock [zlm]::> .turn off the io_thread in one of the slave such as slave and check the status of semi-sync mode both slave and master
slave :
root@localhost:mysql3306.sock [(none)]::>stop slave io_thread;
Query OK, rows affected (0.00 sec) root@localhost:mysql3306.sock [(none)]::>show status like 'rpl%';
+----------------------------+-------+
| Variable_name | Value |
+----------------------------+-------+
| Rpl_semi_sync_slave_status | OFF | -- As soo as the IO_Thread had been stopped,the semi-sync mode immediately turned into async mode.
+----------------------------+-------+
row in set (0.00 sec) root@localhost:mysql3306.sock [(none)]::> master:
root@localhost:mysql3306.sock [zlm]::>show status like 'rpl_semi_sync_master_status';
+-----------------------------+-------+
| Variable_name | Value |
+-----------------------------+-------+
| Rpl_semi_sync_master_status | OFF | -- The value of status changed follow the value on slave.
+-----------------------------+-------+
row in set (0.00 sec) root@localhost:mysql3306.sock [zlm]::> whicn also can be seen in the error log:
--10T13::.870173Z [ERROR] mysqld: Got an error reading communication packets -- Here occured an error.
--10T13::.552523Z [Note] Stop semi-sync binlog_dump to slave (server_id: )
--10T13::.942023Z [Note] Semi-sync replication switched OFF. -- The semi-sync mode was OFF.
--10T13::.942052Z [Note] Aborted connection to db: 'unconnected' user: 'repl' host: 'zlm3' (failed on flush_net()) -- lost connection with slave .
--10T13::.983185Z [Note] Aborted connection to db: 'zlm' user: 'root' host: 'localhost' (Got timeout reading communication packets) .set the parameter "rpl_semi_sync_master_wait_no_slave"=ON on master again.
root@localhost:mysql3306.sock [zlm]::>set global rpl_semi_sync_master_wait_no_slave=ON;
Query OK, rows affected (0.00 sec) root@localhost:mysql3306.sock [zlm]::>show status like 'rpl_semi_sync_master_status';
+-----------------------------+-------+
| Variable_name | Value |
+-----------------------------+-------+
| Rpl_semi_sync_master_status | ON | -- After set "rpl_semi_sync_master_wait_no_slave"=ON,it turned back again with semi-sync mode.
+-----------------------------+-------+
row in set (0.00 sec) root@localhost:mysql3306.sock [zlm]::> slave :
root@localhost:mysql.sock [(none)]::>show status like 'rpl_semi_sync_slave_status';
+----------------------------+-------+
| Variable_name | Value |
+----------------------------+-------+
| Rpl_semi_sync_slave_status | ON | -- slave still can be replicated from master using semi-sync mode.
+----------------------------+-------+
row in set (0.00 sec) root@localhost:mysql.sock [(none)]::> slave :
root@localhost:mysql3306.sock [(none)]::>show status like 'rpl%';
+----------------------------+-------+
| Variable_name | Value |
+----------------------------+-------+
| Rpl_semi_sync_slave_status | OFF | -- only if IO_Thread is stated,the value cannnot be changed.
+----------------------------+-------+
row in set (0.00 sec) root@localhost:mysql3306.sock [(none)]::> .continue to insert into test table "semi_sync_test" wait until up to timeout happen.
master:
root@localhost:mysql3306.sock [zlm]::>show status like 'rpl_semi_sync_master_status';
+-----------------------------+-------+
| Variable_name | Value |
+-----------------------------+-------+
| Rpl_semi_sync_master_status | ON |
+-----------------------------+-------+
row in set (0.00 sec) root@localhost:mysql3306.sock [zlm]::>insert into semi_sync_test(name) values('bbb');
Query OK, row affected (10.01 sec) -- Notice,the time used is "10.01" secsonds which is matched with the parameter "rpl_semi_sync_master_timeout"=. root@localhost:mysql3306.sock [zlm]::>show status like 'rpl_semi_sync_master_status';
+-----------------------------+-------+
| Variable_name | Value |
+-----------------------------+-------+
| Rpl_semi_sync_master_status | OFF |
+-----------------------------+-------+
row in set (0.00 sec) root@localhost:mysql3306.sock [zlm]::> The master become using async mode again on account of the limit time of parameter "rpl_semi_sync_master_timeout". error log of master:
--10T13::.983185Z [Note] Aborted connection to db: 'zlm' user: 'root' host: 'localhost' (Got timeout reading communication packets)
--10T14::.321177Z [Note] Aborted connection to db: 'zlm' user: 'root' host: 'localhost' (Got timeout reading communication packets)
--10T14::.367988Z [Warning] Timeout waiting for reply of binlog (file: mysql-bin., pos: ), semi-sync up to file mysql-bin., position .
--10T14::.368027Z [Note] Semi-sync replication switched OFF. -- the error log also has told you about the change. slave :
root@localhost:mysql.sock [(none)]::>show status like 'rpl_semi_sync_slave_status';
+----------------------------+-------+
| Variable_name | Value |
+----------------------------+-------+
| Rpl_semi_sync_slave_status | ON | -- Even though the value is "ON" in slave ,but it still cannot use semi-sync mode duo to master has changed.
+----------------------------+-------+
row in set (0.00 sec) root@localhost:mysql.sock [(none)]::> slave :
root@localhost:mysql3306.sock [(none)]::>show status like 'rpl%';
+----------------------------+-------+
| Variable_name | Value |
+----------------------------+-------+
| Rpl_semi_sync_slave_status | OFF | -- Slave won't have any change about the value.
+----------------------------+-------+
row in set (0.00 sec) root@localhost:mysql3306.sock [(none)]::> .In the end,let's start the IO_Thread on slave 2 and see what will happen.
slave1:
root@localhost:mysql3306.sock [(none)]::>start slave;
Query OK, rows affected (0.00 sec) root@localhost:mysql3306.sock [(none)]::>show status like 'rpl%';
+----------------------------+-------+
| Variable_name | Value |
+----------------------------+-------+
| Rpl_semi_sync_slave_status | ON |
+----------------------------+-------+
row in set (0.00 sec) root@localhost:mysql3306.sock [(none)]::> slave2:
+----------------------------+-------+
| Variable_name | Value |
+----------------------------+-------+
| Rpl_semi_sync_slave_status | ON |
+----------------------------+-------+
row in set (0.00 sec) root@localhost:mysql.sock [(none)]::> master:
root@localhost:mysql3306.sock [zlm]::>show status like 'rpl_semi_sync_master_status';
+-----------------------------+-------+
| Variable_name | Value |
+-----------------------------+-------+
| Rpl_semi_sync_master_status | ON |
+-----------------------------+-------+
row in set (0.00 sec) root@localhost:mysql3306.sock [zlm]::> master error log:
--10T14::.905142Z [Note] Aborted connection to db: 'zlm' user: 'root' host: 'localhost' (Got timeout reading communication packets)
--10T14::.140168Z [Note] Start binlog_dump to master_thread_id() slave_server(), pos(, )
--10T14::.438034Z [Note] Start semi-sync binlog_dump to slave (server_id: ), pos(, )
--10T14::.447797Z [Note] Semi-sync replication switched ON at (mysql-bin., ) -- became semi-sync mode eventually.
Summary:
  • there're sevaral restrictions when using semi-synchronous replication:
  • based on MySQL 5.5 or above version.
  • parameter "have_dynamic_loading" must be set as "yes".
  • replication must has been normally worked such as asynchronous mode.
  • merely compatible with default replication channel.
  • take care of the converting condition between semi-sync and async mode due to timeout.
  • in order to keep consistency of replication,increase the value of "rpl_semi_sync_master_timeout" close to an infinite value maybe makeshift.

MySQL 5.7增强半同步测试的更多相关文章

  1. Bullet:MySQL增强半同步参数rpl_semi_sync_master_wait_point值AFTER_SYNC和AFTER_COMMIT的对比实验

    MySQL 5.7.22启用增强半同步复制 MySQL对该参数值的描述 Semisync can wait for slave ACKs at one of two points, AFTER_SYN ...

  2. MySQL 5.7的复制架构,在有异步复制、半同步、增强半同步、MGR等的生产中,该如何选择?

    一.生产环境中: 几种复制场景都有存在的价值.下面分别描述一下: 从成熟度上来选择,推荐:异步复制(GTID+ROW) 从数据安全及更高性能上选择:增强半同步 (在这个结构下也可以把innodb_fl ...

  3. MySQL增强半同步的搭建实验,和一些参数的个人理解

    关于参数理解,已补充实验,可以查看: rpl_semi_sync_master_wait_no_slave 参数研究实验 环境信息 role ip port hostname master 192.1 ...

  4. (MHA+MYSQL-5.7增强半同步)高可用架构设计与实现

           架构使用mysql5.7版本基于GTD增强半同步并行复制配置 reploication 一主两从,使用MHA套件管理整个复制架构,实现故障自动切换高可用        优势:       ...

  5. Mysql的ssl主从复制+半同步主从复制

    Mysql的ssl主从复制+半同步主从复制 准备工作 1.主从服务器时间同步 [root@localhost ~]# crontab -e */30 * * * * /usr/sbin/ntpdate ...

  6. 深入MySQL复制(三):半同步复制

    1.半同步复制 半同步复制官方手册:https://dev.mysql.com/doc/refman/5.7/en/replication-semisync.html 默认情况下,MySQL的复制是异 ...

  7. 搭建MySQL的主从、半同步、主主复制架构

    复制其最终目的是让一台服务器的数据和另外的服务器的数据保持同步,已达到数据冗余或者服务的负载均衡.一台主服务器可以连接多台从服务器,并且从服务器也可以反过来作为主服务器.主从服务器可以位于不同的网络拓 ...

  8. MySQL/MariaDB数据库的半同步复制

      MySQL/MariaDB数据库的半同步复制 作者:尹正杰  版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.MySQL半同步复制概述 1>.MySQL默认的异步复制 默认情况下,M ...

  9. MySQL 5.7 新特性之增强半同步复制

    1. 背景介绍 半同步复制 普通的replication,即mysql的异步复制,依靠mysql二进制日志也即binary log进行数据复制.比如两台机器,一台主机(master),另外一台是从机( ...

随机推荐

  1. ArcGIS 编程中对接口的理解

    学习AO,最重要的是理解“接口”这个概念.接口是什么?有什么具体作用?在多种计算机高级语言中,都可以看到“接口”这个术语,但基本上每一本书对“为什么使用接口”等重要文都都“语焉不详”,使得初学者往往不 ...

  2. visual studio 2013的C++开发环境不错--vs2013安装试用手记

    原文:http://blog.csdn.net/haoyujie/article/details/24370189 从visual studio 体系,最后一次对C++实现了大的改进,那还是vs 7. ...

  3. 关于比特币的“冷存储”和Armory的使用

    转自:http://8btc.com/thread-1164-1-1.html 最近随着比特币话题的火热,又有一批人卖房或倾产换成比特币入圈,这一次与以前不同的是,以前倾产入圈的人都是技术人员,有足够 ...

  4. Python unittest模块心得(二)

    基础概念介绍请参看: http://www.cnblogs.com/frost-hit/p/8295818.html 组织测试用例 unittest.TestSuite(tests=()): 除了使用 ...

  5. 文本处理三剑客之 Sed ——高级编辑命令

    本篇介绍sed的高级编辑命令 高级编辑命令 P:打印模式空间开端至\n内容,并追加到默认输出之前 n: 读取匹配到的行的下一行覆盖至模式空间 N:读取匹配到的行的下一行追加至模式空间 h: 把模式空间 ...

  6. easyui学习笔记1—增删改操作

    最近公司要用easyui,这里自己看了官网几篇文章,遇到些问题,大多数的问题都是敲代码的时候笔误,其他有些地方确实需要注意一下,这里做些笔记. 1.在mysql中建好表之后修改id字段为递增字段,发现 ...

  7. WiFi安全测试工具WiFiPhisher

    官方下载地址:https://github.com/sophron/wifiphisher打不开的要翻GFW好事做到底wifiphisher-master.zip=================== ...

  8. HashMap 和 ConcurrentHashMap,Java1.8版本

    1. HashMap Entry,一对kv就是一个Entry,还包括一些next指针,用来解决散列冲突. table,内部用来存储Entry的数组,resize时候table会成倍扩容. 容量,tab ...

  9. 迷宫问题求解——C++

    迷宫问题思路 根据昨天的博客,有如下几种解决方案 克鲁斯卡尔 ,为避免死循环,需要设定优化路径的次数. Prim,为避免死循环,需要设定优化路径的次数,暂定200次. BFS , 实现简单,无死循环. ...

  10. mongodb 备份、还原、导入、导出

    mongodump备份数据库 常用的备份命令格式 mongodump -h IP --port 端口 -u 用户名 -p 密码 -d 数据库 -o 文件存在路径 如果想导出所有数据库,可以去掉-d - ...