MySQL 5.7增强半同步测试
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.
- 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增强半同步测试的更多相关文章
- 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 ...
- MySQL 5.7的复制架构,在有异步复制、半同步、增强半同步、MGR等的生产中,该如何选择?
一.生产环境中: 几种复制场景都有存在的价值.下面分别描述一下: 从成熟度上来选择,推荐:异步复制(GTID+ROW) 从数据安全及更高性能上选择:增强半同步 (在这个结构下也可以把innodb_fl ...
- MySQL增强半同步的搭建实验,和一些参数的个人理解
关于参数理解,已补充实验,可以查看: rpl_semi_sync_master_wait_no_slave 参数研究实验 环境信息 role ip port hostname master 192.1 ...
- (MHA+MYSQL-5.7增强半同步)高可用架构设计与实现
架构使用mysql5.7版本基于GTD增强半同步并行复制配置 reploication 一主两从,使用MHA套件管理整个复制架构,实现故障自动切换高可用 优势: ...
- Mysql的ssl主从复制+半同步主从复制
Mysql的ssl主从复制+半同步主从复制 准备工作 1.主从服务器时间同步 [root@localhost ~]# crontab -e */30 * * * * /usr/sbin/ntpdate ...
- 深入MySQL复制(三):半同步复制
1.半同步复制 半同步复制官方手册:https://dev.mysql.com/doc/refman/5.7/en/replication-semisync.html 默认情况下,MySQL的复制是异 ...
- 搭建MySQL的主从、半同步、主主复制架构
复制其最终目的是让一台服务器的数据和另外的服务器的数据保持同步,已达到数据冗余或者服务的负载均衡.一台主服务器可以连接多台从服务器,并且从服务器也可以反过来作为主服务器.主从服务器可以位于不同的网络拓 ...
- MySQL/MariaDB数据库的半同步复制
MySQL/MariaDB数据库的半同步复制 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.MySQL半同步复制概述 1>.MySQL默认的异步复制 默认情况下,M ...
- MySQL 5.7 新特性之增强半同步复制
1. 背景介绍 半同步复制 普通的replication,即mysql的异步复制,依靠mysql二进制日志也即binary log进行数据复制.比如两台机器,一台主机(master),另外一台是从机( ...
随机推荐
- 关于Array的操作
使用Array创建数组 // 使用Array 构造函数 var colors = new Array(); // 预先给数组项数量 var colors = new Array(20); // 向Ar ...
- 关于Function原型对象和Object原型对象的一些疑惑
网上有一道美团外卖的面试题是这样的: Function.prototype.a = 'a'; Object.prototype.b = 'b'; function Person(){}; var p ...
- CentOS安装软件出现错误:bash: /usr/local/bin/rar: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
CentOS安装软件出现错误: bash: /usr/local/bin/rar: /lib/ld-linux.so.2: bad ELF interpreter: No such file or d ...
- idea引入依赖包报错
今天在更新项目的时候,maven依赖的一个服务一直报错.查了后发现原来是因为缺少依赖包.但是依赖包明明在我本地啊. 又重新下载,依然如故... 搞了半天,发现自己的依赖包类状态都是不可用的.如下图所示 ...
- idea 出现 java.lang.OutOfMemoryError: PermGen space
今天在项目启动时候,刚刚启动 就 报了 Exception in thread "http-bio-8080-exec-1" 之后 出现了 java.lang.OutOfMemor ...
- salt 之 master and minion
系统:centos7.2 master:192.168.1.41minion:192.168.1.46 注释: setenforce 0 --关闭selinux systemctl stop fire ...
- 设计模式:观察者(Observer)模式
设计模式:观察者(Observer)模式 一.前言 观察者模式其实最好的名称应该是“发布订阅”模式,和我们现在大数据之中的发布订阅方式比较类似,但是也有区别的地方,在上一个设计模式,我们学习的是仲 ...
- 你不能不知道到的Hook!
Hook是什么? hook翻译之后是钩子的意思,hook的用途主要是用来拦截消息的,看到这里大家可能会迷茫,What is a hook?所以这时就不得不普及一下操作系统的原理. 举个例子:假 ...
- January 15 2017 Week 3 Sunday
A good book is the best of friends, the same today and forever. 好书乃挚友,情谊永不渝. For a coder, that is no ...
- Intellij IDEA 修改编辑器背景颜色
对眼睛有益的RGB数值分别是(199,237,204)