MySQL半同步SLAVE是什么-創(chuàng)新互聯(lián)

這篇文章主要介紹“MySQL半同步SLAVE是什么”,在日常操作中,相信很多人在MySQL半同步SLAVE是什么問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對(duì)大家解答”MySQL半同步SLAVE是什么”的疑惑有所幫助!接下來,請(qǐng)跟著小編一起來學(xué)習(xí)吧!

在從化等地區(qū),都構(gòu)建了全面的區(qū)域性戰(zhàn)略布局,加強(qiáng)發(fā)展的系統(tǒng)性、市場(chǎng)前瞻性、產(chǎn)品創(chuàng)新能力,以專注、極致的服務(wù)理念,為客戶提供成都做網(wǎng)站、成都網(wǎng)站建設(shè) 網(wǎng)站設(shè)計(jì)制作定制網(wǎng)站,公司網(wǎng)站建設(shè),企業(yè)網(wǎng)站建設(shè),品牌網(wǎng)站制作,網(wǎng)絡(luò)營銷推廣,成都外貿(mào)網(wǎng)站建設(shè)公司,從化網(wǎng)站建設(shè)費(fèi)用合理。

Mysql半同步SLAVE,類似于ORACLE安全模式的DATAGUARD(但不完全是);
為什么是半同步呢,因?yàn)镸YSQL只保證“至少一個(gè)”SLAVE接收到日志后返回;
 雖然可能不會(huì)有太多的人去用這個(gè)東西(因?yàn)閷?duì)網(wǎng)絡(luò)的要求和機(jī)器的穩(wěn)定性很高);但MYSQL還是補(bǔ)全了這一塊的功能缺失

 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
如果日志傳輸過程中發(fā)生超時(shí)現(xiàn)象;那么SLAVE將恢復(fù)到異步方式;
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
半同步復(fù)制方式必須在MASTER和SLAVE同時(shí)打開;否則還是采用異步方式;
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接受到日志或超時(shí)之前,MASTER對(duì)SESSION的COMMIT請(qǐng)求不作返回響應(yīng);
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.
滾回操作,即使對(duì)事務(wù)表沒有影響,也同樣會(huì)被記錄到日志里,因?yàn)椤靶薷摹睍?huì)非事務(wù)表是不可回滾的,所以必須也傳輸?shù)絊LAVE;
對(duì)于自動(dòng)提交的語句; MASTER將被在每個(gè)語句結(jié)束后BLOCK??;

## 幾個(gè)系統(tǒng)變量設(shè)置
rpl_semi_sync_master_enabled=1 # 打開MASTER支持semisynchronous replication
rpl_semi_sync_slave_enabled=1  # 打開Slave 支持semisynchronous replication
rpl_semi_sync_master_timeout   # 等待SLAVE超時(shí)時(shí)間;1MS,默認(rèn)10000MS
rpl_semi_sync_master_wait_no_slave  # 在超時(shí)之前,如果SLAVE都DOWN了,是不是還繼續(xù)等待直到超時(shí);默認(rèn)打開 ;

## 幾個(gè)狀態(tài)變量
Rpl_semi_sync_master_status   # 查看MASTER是否支持semisynchronous replication
Rpl_semi_sync_slave_status    # 查看SLAVE 是否支持semisynchronous replication
Rpl_semi_sync_master_clients  # 查看后面跟著幾個(gè)semisynchronous slaves
Rpl_semi_sync_master_yes_tx   # 成功傳輸了多少個(gè)事務(wù);
Rpl_semi_sync_master_no_tx    # 失敗傳輸了多少個(gè)事務(wù);

到此,關(guān)于“MySQL半同步SLAVE是什么”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實(shí)踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識(shí),請(qǐng)繼續(xù)關(guān)注創(chuàng)新互聯(lián)-成都網(wǎng)站建設(shè)公司網(wǎng)站,小編會(huì)繼續(xù)努力為大家?guī)砀鄬?shí)用的文章!

當(dāng)前題目:MySQL半同步SLAVE是什么-創(chuàng)新互聯(lián)
轉(zhuǎn)載源于:http://www.muchs.cn/article22/dhojcc.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供定制網(wǎng)站品牌網(wǎng)站建設(shè)、關(guān)鍵詞優(yōu)化做網(wǎng)站、手機(jī)網(wǎng)站建設(shè)、外貿(mào)建站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

外貿(mào)網(wǎng)站制作