新聞中心
replSet error RS102 too stale to catch up

輔助副本成員需要關機增加內(nèi)存,很早就提前關機,等第二天服務器起來后,去查看rs.status()信息,會捕獲到"stateStr" : "RECOVERING"。其實早已超過了維護窗口時間。這時,如果運氣好的話,會看到error RS102 too stale to catch up錯誤。而該錯誤是每十分鐘會捕獲到一次。從mongodb的日志文件可以看到:
Thu Mar 26 20:50:48.561 [rsBackgroundSync] replSet error RS102 too stale to catch up, at least from dal05mgo13.sl.dx:27017 Thu Mar 26 20:50:48.561 [rsBackgroundSync] replSet error RS102 too stale to catch up Thu Mar 26 21:00:49.632 [rsBackgroundSync] replSet error RS102 too stale to catch up, at least from dal05mgo13.sl.dx:27017 Thu Mar 26 21:00:49.632 [rsBackgroundSync] replSet error RS102 too stale to catch up Thu Mar 26 21:10:50.701 [rsBackgroundSync] replSet error RS102 too stale to catch up, at least from dal05mgo12.sl.dx:27017 Thu Mar 26 21:10:50.701 [rsBackgroundSync] replSet error RS102 too stale to catch up Thu Mar 26 21:20:51.770 [rsBackgroundSync] replSet error RS102 too stale to catch up, at least from dal05mgo13.sl.dx:27017 Thu Mar 26 21:20:51.770 [rsBackgroundSync] replSet error RS102 too stale to catch up確認維護窗口大小
查看主副本的維護窗口和oplog大?。?/p>rs_main:PRIMARY> db.printReplicationInfo() configured oplog size: 23552MB log length start to end: 38133secs (10.59hrs) oplog first event time: Mon Mar 30 2015 12:00:13 GMT-0500 (CDT) oplog last event time: Mon Mar 30 2015 22:35:46 GMT-0500 (CDT) now: Mon Mar 30 2015 22:35:46 GMT-0500 (CDT)
可以看到維護窗口為10個小時,oplog大小為23G。
輔助副本的維護窗口大小最好跟主副本成員保持一致,讓輔助副本能保存從主副本同步過來的oplog。
如何重建oplog?
以standalone方式啟動,執(zhí)行如下刪除和創(chuàng)建腳本:
> use local > db.oplog.rs.drop() > db.createCollection("oplog.rs", {"capped" : true, "size" : 23 * 1024 * 1024 * 1024}) 或 > db.runCommand( { create: "oplog.rs", capped: true, size: (23 * 1024 * 1024 * 1024) } )replSet error RS102 too stale to catch up如何處理?
副本集錯誤RS102太陳舊而無法跟上。說明此節(jié)點由于脫離副本集時間太長,已經(jīng)跟不上整個集群了。需要重新同步該輔助副本成員。可參考:
http://docs.mongodb.org/manual/tutorial/resync-replica-set-member/
官方手冊建議,通過移除數(shù)據(jù)實施初始化同步(initial sync)來完全重新同步成員。
MongoDB提供了兩種實施初始化同步的方法:
清空數(shù)據(jù)目錄,重啟mongod。讓MongoDB的正常初始化同步數(shù)據(jù)恢復數(shù)據(jù)。這個方法更簡單,但是需要花更多的時間替換數(shù)據(jù)。
從副本集中的另一個成員拷貝當前的數(shù)據(jù)目錄,重啟機器。這個過程替換數(shù)據(jù)更快,但是需要更多手工步驟。
另外有需要云服務器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務器、裸金屬服務器、高防服務器、香港服務器、美國服務器、虛擬主機、免備案服務器”等云主機租用服務以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應用場景需求。
網(wǎng)頁題目:replSeterrorRS102toostaletocatchup-創(chuàng)新互聯(lián)
新聞來源:http://www.dlmjj.cn/article/csjpei.html


咨詢
建站咨詢
