一旦 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 大小。在这里您可以找到方法!
问题是在初始同步期间没有足够的信息存储“发生了什么”(对集合的更改)。