Mongodb
mongorestore 完成後的問題
一旦 mongorestore 完成。
大多數情況下,在主節點上完成還原後,其中一個節點將無法擷取主節點,並且該節點變得太陳舊而無法從主節點複製。
這可能是什麼原因?
RS:PRIMARY> rs.printReplicationInfo() configured oplog size: 4096MB log length start to end: 18196secs (5.05hrs) oplog first event time: Sat Aug 14 2021 00:32:18 GMT+***** oplog last event time: Sat Aug 14 2021 05:35:34 GMT+***** now: Sat Aug 14 2021 05:35:39 GMT+***** RS:PRIMARY> RS:RECOVERING> rs.printReplicationInfo() configured oplog size: 4096MB log length start to end: 679secs (0.19hrs) oplog first event time: Fri Aug 13 2021 23:38:21 GMT+***** oplog last event time: Fri Aug 13 2021 23:49:40 GMT+***** now: Sat Aug 14 2021 05:27:25 GMT+***** RS:RECOVERING> RS:SECONDARY> rs.printReplicationInfo() configured oplog size: 4096MB log length start to end: 17892secs (4.97hrs) oplog first event time: Sat Aug 14 2021 00:32:19 GMT+***** oplog last event time: Sat Aug 14 2021 05:30:31 GMT+***** now: Sat Aug 14 2021 05:30:40 GMT+***** RS:SECONDARY>
您必須增加主節點的 oppLog 大小。在這裡你可以找到如何!
問題是在初始同步期間沒有足夠的資訊儲存“發生了什麼”(對集合的更改)。