MySQL now supports an interface for semisynchronous replication:
為什麼是半同步呢,因為MYSQL只保證“至少一個”SLAVE接收到日誌後返回;
雖然可能不會有太多的人去用這個東西(因為對網路的要求和機器的穩定性很高);但MYSQL還是補全了這一塊的功能缺失[@more@]
A commit performed on the master side blocks before returning to the session
that performed the transaction until at least one slave acknowledges that it has received
and logged the events for the transaction.
Semisynchronous replication is implemented through an optional plugin component.
See Section 17.3.8, “Semisynchronous Replication”.
http://dev.mysql.com/doc/refman/5.5/en/replication-semisync.html
The slave acknowledges receipt of a transaction's events only after the events have been written to its relay log and flushed to disk.
只有SLAVE接收到日誌寫入到RELAY-LOG,並重新整理到磁碟才算同步成功;
If a timeout occurs without any slave having acknowledged the transaction, the master reverts to asynchronous replication
如果日誌傳輸過程中發生超時現象;那麼SLAVE將恢復到非同步方式;
Semisynchronous replication must be enabled on both the master and slave sides. If semisynchronous replication is disabled on the master, or enabled on the master but on no slaves, the master uses asynchronous replication
半同步複製方式必須在MASTER和SLAVE同時開啟;否則還是採用非同步方式;
While the master is blocking (waiting for acknowledgment from a slave after having performed a commit), it does not return to the session that performed the transaction
在SLAVE接受到日誌或超時之前,MASTER對SESSION的COMMIT請求不作返回響應;
The rolled-back transaction is logged even though it has no effect for transactional tables because the modifications to the nontransactional tables cannot be rolled back and must be sent to slaves.
滾回操作,即使對事務表沒有影響,也同樣會被記錄到日誌裡,因為“修改”會非事務表是不可回滾的,所以必須也傳輸到SLAVE;
對於自動提交的語句; MASTER將被在每個語句結束後BLOCK住;
## 幾個系統變數設定
rpl_semi_sync_master_enabled=1 # 開啟MASTER支援semisynchronous replication
rpl_semi_sync_slave_enabled=1 # 開啟Slave 支援semisynchronous replication
rpl_semi_sync_master_timeout # 等待SLAVE超時時間;1MS,預設10000MS
rpl_semi_sync_master_wait_no_slave # 在超時之前,如果SLAVE都DOWN了,是不是還繼續等待直到超時;預設開啟 ;
## 幾個狀態變數
Rpl_semi_sync_master_status # 檢視MASTER是否支援semisynchronous replication
Rpl_semi_sync_slave_status # 檢視SLAVE 是否支援semisynchronous replication
Rpl_semi_sync_master_clients # 檢視後面跟著幾個semisynchronous slaves
Rpl_semi_sync_master_yes_tx # 成功傳輸了多少個事務;
Rpl_semi_sync_master_no_tx # 失敗傳輸了多少個事務;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/703656/viewspace-1042160/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MySQL 8.0 Reference Manual(讀書筆記93節--Semisynchronous Replication)MySql筆記
- Build mysql replicationUIMySql
- MySQL Group ReplicationMySql
- MySQL基於GTIDs的MySQL ReplicationMySql
- Mysql replication check指令碼MySql指令碼
- MySQL group replication介紹MySql
- An Overview of PostgreSQL & MySQL Cross ReplicationViewMySqlROS
- Mysql Replication學習記錄MySql
- CSS3 @supportsCSSS3
- MYSQL Group Replication搭建過程記錄MySql
- MGR(MySQL Group Replication)部署搭建測試MySql
- 【MySQL】MySQL Replication 一主一備搭建步驟(GTID方式)MySql
- MySQL8.0.16新特性:The Communication Protocol In Group ReplicationMySqlProtocol
- 【MySQL】MySQL Replication 一主一備搭建步驟(傳統方式)MySql
- 配置Mysql Group Replication遇到的問題筆記MySql筆記
- Androidstudio除錯真機提示-Device supports,but APK only supports armeabi rmeabi-v7aAndroid除錯devAPK
- Mysql 5.7 基於組複製(MySQL Group Replication) - 運維小結MySql運維
- MySQL 8.0 Reference Manual(讀書筆記90節--Replication)MySql筆記
- Geo-replication: 從 Copysets 到 Tiered Replication
- TNS問題排查 The listener supports no services
- From now on
- MySQL 8.0 Reference Manual(讀書筆記94節--Replication(5))MySql筆記
- MySQL 8.0 Reference Manual(讀書筆記92節--Replication(3))MySql筆記
- MySQL 8.0 Reference Manual(讀書筆記91節--Replication(2))MySql筆記
- Mysql 建立心跳錶來監控Replication的Slave是否延遲MySql
- Everybody dance now
- JavaScript Date.now()JavaScript
- HBase Replication詳解
- The ArrayAccess interface
- interface/介面
- How to Optimize PostgreSQL Logical ReplicationSQL
- 使用ProxySQL實現MySQL Group Replication的故障轉移、讀寫分離(一)MySql
- golang使用sqlx報錯:unsupported type []interface {}, a slice of interfaceGolangSQL
- Interface中加Static
- Golang之interfaceGolang
- mysql 觸發器SQLSTATE[42S22] 'now.order_no' in 'field list' 的錯誤MySql觸發器
- public interface View介面和public interface ViewResolver介面介紹View
- Replication (Part 2): Transactions, Consistency and Consensus
- Redis replication 中的探活Redis