由于无效的BSONSize,mongorestore失败 [英] mongorestore fails due to invalid BSONSize
本文介绍了由于无效的BSONSize,mongorestore失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个转储mongodb的脚本
I have a script which dumps a mongodb
mongodump --archive=$MONGODB_PATH --host $MONGODB_HOST --port $MONGODB_PORT --username $MONGODB_USER --password $MONGODB_PASS --db $MONGODB_NAME
但是当我尝试使用
mongorestore -d db_name backup/dump
它失败并显示:
Failed: dump_name: error restoring from backup/dump/dump_name: reading bson input: invalid BSONSize: -2120621459 bytes
我尝试了--batchSize=100
,但它并没有为我解决问题.
I tried --batchSize=100
but it didn't solve the issue for me.
这是怎么回事?
解决方案是:
mongorestore --archive=backup/dump
推荐答案
使用--archive
标志转储时,还必须使用--archive
标志进行还原.
When you dump with --archive
flag you must restore with --archive
flag as well.
这篇关于由于无效的BSONSize,mongorestore失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文