啟用auto_position=1一直報錯 Got fatal error 1236 from master when reading data from binary log: 'The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requires.', Error_code: 1236
gtid中一些變量的理解
Retrieved_Gtid_Set: 接收到gtid集合
Executed_Gtid_Set: slave 已經執(zhí)行過gtid集合,這個值使用從庫的gtid_executed 這個變量初始化
gtid_executed:執(zhí)行過的gtid集合
gtid_purged:已經被purge清除掉gtid集合
在執(zhí)行start slave 的時候 ,如何計算起始的gtid值/集合
在從庫已經執(zhí)行的gtid集合
gtid_executed={0dd527e9-af3e-11e8-9ed6-00505683b926:1-62,0dd527e9-af3e-11e8-9ed6-00505683b927:1-3,87cf7b97-c393-11e8-845b-005056a95814:1,bb014309-e1a6-11e8-b284-00505683b926:1-12,c488995b-e256-11e8-abb7-00505683b926:1-9}
主庫上執(zhí)行的gtid集合
master_gtid_executed = { c488995b-e256-11e8-abb7-00505683b926:1-10 }
主庫發(fā)送給從庫的第一個gtid值(也可能是一個集合)
send_first_gtids={master_gtid_executed - gtid_executed}
send_first_gtids = { c488995b-e256-11e8-abb7-00505683b926:10 }
這個時候就計算出master需要發(fā)送給slave的第一個gtid值/集合,
如果這個值已經被master purge清理掉了(也就說在master的binlog文件中找不到了)
slave 就會報錯 1236 錯誤
具體報錯如下 :
Got fatal error 1236 from master when reading data from binary log: 'The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requires.', Error_code: 1236
對于這種錯誤 有兩種解決方案
1.重做slave
2.找到歷史的binlog文件,收到從binlog文件cp出需要的gtid集合日志在slave執(zhí)行(這里需用到mysqlbinlog --include-gtids ),重新初始化從庫的gtid_executed 的值
另外有需要云服務器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內外云服務器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務器、裸金屬服務器、高防服務器、香港服務器、美國服務器、虛擬主機、免備案服務器”等云主機租用服務以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應用場景需求。
本文名稱:啟用auto_position=1一直報錯-創(chuàng)新互聯(lián)
文章位置:http://chinadenli.net/article10/ddidgo.html
成都網站建設公司_創(chuàng)新互聯(lián),為您提供網站建設、App開發(fā)、域名注冊、網站策劃、網站排名、企業(yè)建站
聲明:本網站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)