半同步复制:
原理图
概要:改变了传统的复制协议(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
+-----------------------+-------+
| 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)
- Replication_fail_io_connections - on a slave, number of times the IO thread has disconnected from the master because of an error
- Replication_total_io_connections - number of connections made by the IO thread to the master
- Replication_last_event_buffered - on a slave, time when last replication event received
- Replication_last_event_done - on a slave, time when last replication event replayed
没有评论:
发表评论