2009年6月29日星期一

The v2 patch 之 SemiSyncReplication

引自:http://code.google.com/p/google-mysql-tools/wiki/SemiSyncReplicationDesign
半同步复制:
原理图概要:
改变了传统的复制协议(tcp/ip)
改变了commit的方式:至少一个副本已经确认得到更改后进行commit,基本可以 保证数据的一致性,主从服务器都要设定,目前仅对innodb有效
parameters:
  • rpl_semi_sync_enabled configures a master to use semi-sync replication.
  • rpl_semi_sync_slave_enabled configures a slave to use semi-sync replication. The IO thread must be restarted for this to take effect.
  • rpl_semi_sync_timeout is the timeout in milliseconds for the master
mysql> show variables like 'rpl_semi_sync_enabled';
+-----------------------+-------+
| Variable_name | Value |
+-----------------------+-------+
| rpl_semi_sync_enabled | 0 |
+-----------------------+-------+
1 row in set (0.01 sec)

mysql> show variables like 'rpl_semi_sync_slave_enabled';
+-----------------------------+-------+
| Variable_name | Value |
+-----------------------------+-------+
| rpl_semi_sync_slave_enabled | 0 |
+-----------------------------+-------+
1 row in set (0.01 sec)

mysql> show variables like 'rpl_semi_sync_timeout';
+-----------------------+-------+
| Variable_name | Value |
+-----------------------+-------+
| rpl_semi_sync_timeout | 10 |
+-----------------------+-------+
1 row in set (0.00 sec)

mysql> show status like 'rpl%';
+-------------------------------------+-------+
| Variable_name | Value |
+-------------------------------------+-------+
| Rpl_semi_sync_clients | 0 |
| Rpl_semi_sync_net_avg_wait_time(us) | 0 |
| Rpl_semi_sync_net_wait_time | 0 |
| Rpl_semi_sync_net_waits | 0 |
| Rpl_semi_sync_no_times | 0 |
| Rpl_semi_sync_no_tx | 0 |
| Rpl_semi_sync_status | 0 |
| Rpl_semi_sync_slave_status | 0 |
| Rpl_semi_sync_timefunc_failures | 0 |
| Rpl_semi_sync_tx_avg_wait_time(us) | 0 |
| Rpl_semi_sync_tx_wait_time | 0 |
| Rpl_semi_sync_tx_waits | 0 |
| Rpl_semi_sync_wait_pos_backtraverse | 0 |
| Rpl_semi_sync_wait_sessions | 0 |
| Rpl_semi_sync_yes_tx | 0 |
| Rpl_status | NULL |
| Rpl_transaction_support | OFF |
+-------------------------------------+-------+
17 rows in set (0.00 sec)

没有评论:

发表评论