xuke123 发表于 2018-10-2 07:12:08

mysql的主从复制与半同步复制(一)

mysql> show global status like 'rpl_semi%';  
+--------------------------------------------+-------+
  
| Variable_name                              | Value |
  
+--------------------------------------------+-------+
  
| Rpl_semi_sync_master_clients               | 1   |
  
| Rpl_semi_sync_master_net_avg_wait_time   | 0   |
  
| Rpl_semi_sync_master_net_wait_time         | 0   |
  
| Rpl_semi_sync_master_net_waits             | 0   |
  
| Rpl_semi_sync_master_no_times            | 0   |
  
| Rpl_semi_sync_master_no_tx               | 0   |
  
| Rpl_semi_sync_master_status                | ON    |
  
| Rpl_semi_sync_master_timefunc_failures   | 0   |
  
| Rpl_semi_sync_master_tx_avg_wait_time      | 0   |
  
| Rpl_semi_sync_master_tx_wait_time          | 0   |
  
| Rpl_semi_sync_master_tx_waits            | 0   |
  
| Rpl_semi_sync_master_wait_pos_backtraverse | 0   |
  
| Rpl_semi_sync_master_wait_sessions         | 0   |
  
| Rpl_semi_sync_master_yes_tx                | 0   |
  
+--------------------------------------------+-------+
  
14 rows in set (0.00 sec)
  
mysql> show global variables like '%rpl%';
  
+------------------------------------+-------+
  
| Variable_name                      | Value |
  
+------------------------------------+-------+
  
| rpl_recovery_rank                  | 0   |
  
| rpl_semi_sync_master_enabled       | ON    |
  
| rpl_semi_sync_master_timeout       | 1000|
  
| rpl_semi_sync_master_trace_level   | 32    |
  
| rpl_semi_sync_master_wait_no_slave | ON    |
  
+------------------------------------+-------+
  
5 rows in set (0.00 sec)
  
...............
  
mysql> show global status like 'rpl_semi%';
  
+----------------------------+-------+
  
| Variable_name            | Value |
  
+----------------------------+-------+
  
| Rpl_semi_sync_slave_status | ON    |
  
+----------------------------+-------+
  
1 row in set (0.00 sec)
  
mysql> show global variables like '%rpl%';
  
+---------------------------------+-------+
  
| Variable_name                   | Value |
  
+---------------------------------+-------+
  
| rpl_recovery_rank               | 0   |
  
| rpl_semi_sync_slave_enabled   | ON    |
  
| rpl_semi_sync_slave_trace_level | 32    |
  
+---------------------------------+-------+
  
3 rows in set (0.00 sec)
  
................
  
# mysql -e 'show slave status\G'
  
*************************** 1. row ***************************
  Slave_IO_State: Waiting for master to send event
  Master_Host: 172.16.200.5
  Master_User: zly
  Master_Port: 3306
  Connect_Retry: 60
  Master_Log_File: mysql-bin.000011
  Read_Master_Log_Pos: 453

  Relay_Log_File:>  Relay_Log_Pos: 253
  Relay_Master_Log_File: mysql-bin.000011
  Slave_IO_Running: Yes
  Slave_SQL_Running: Yes


页: [1]
查看完整版本: mysql的主从复制与半同步复制(一)