我使用 mongodump dump mongodb oplog:
mongodump -h 127.0.0.1:27017 -d local -c oplog.rs -o /data/tmp/rs2
然后使用 mongorestore oplogReplay oplogLimit :
mongorestore -h 192.168.95.113:27017 --oplogReplay --oplogLimit "1633935142:1" --dir /data/tmp/rs2/
我收到此错误:
2021-10-12T10:18:38.170+0800 preparing collections to restore from
2021-10-12T10:18:38.187+0800 replaying oplog
2021-10-12T10:18:38.245+0800 Failed: restore error: error applying oplog: applyOps: cannot apply insert or update operation on a non-existent namespace