本文介绍了mongorestore失败:恢复错误:应用操作日志时出错:applyOps:EOF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用下一条命令创建了mongodb dump:

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

它将还原所有数据库,并且无法重播oplog:

It restores all db and fails to replay oplog:

本地mongoDB版本:3.0.2(Windows 7)

local mongoDB version: 3.0.2 (Windows 7)

远程mongoDB版本:2.6.7(Windows 8)

remote mongoDB version: 2.6.7 (Windows 8)

推荐答案

这是 MongoDB工具.我在GitHub项目上提出了拉动请求.

This is a bug with the Go version of the MongoDB tools. I made a pull request on the GitHub project.

如果要立即解决,请更改 mongorestore/oplog.go 1024 * 1024 * 16.51024 * 1024 * 8.然后重新编译mongorestore工具.

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.

更新

这是 JIRA问题.这是官方错误修复.

这篇关于mongorestore失败:恢复错误:应用操作日志时出错:applyOps:EOF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 18:49