问题
I created mongodb dump with next command:
mongodump /host:%MONGODB_HOST% /authenticationDatabase:admin /username:username /password:password /oplog
After that I'm trying to restore dump with a command:
mongorestore /noIndexRestore /oplogReplay /numParallelCollections:1 dump
It restores all db and fails to replay oplog:
Failed: restore error: error applying oplog: applyOps: EOF
local mongoDB version: 3.0.2 (Windows 7)
remote mongoDB version: 2.6.7 (Windows 8)
回答1:
This is a bug with the Go version of the MongoDB tools. I made a pull request on the GitHub project.
If you want an immediate solution, change the value of the oplogMaxCommandSize
constant on line 17 of mongorestore/oplog.go from 1024 * 1024 * 16.5
to 1024 * 1024 * 8
. Then recompile the mongorestore
tool.
Update
Here is the JIRA issue. And here is the official bug fix.
来源:https://stackoverflow.com/questions/30012055/mongorestore-failed-restore-error-error-applying-oplog-applyops-eof