场景:原来用的mongodb是tokumx-2.0.0,现在的mongodb是原版的mongodb3.0.7,在使用mongorestore对
tokumx-2.0.0下的dump文件进行恢复时报错,在后台查看到错误信息:
2015-11-05T10:31:30.131+0800 I NETWORK [conn12] AssertionException handling request, closing client connection: 10334 BSONObj size: 17794400 (0x10F8560) is invalid. Size must be between 0 and 16793600(16MB) First element: insert: "lesson_max_scores_per_user"
搜罗一番找到解决办法,加参数 --batchSize=10
I had same problem with mongo 3.0.0 and 3.1.9 with relatively small database (12GB).
After wasting roughly 4 hours of time on this I found workaround using hidden parameter
mongorestore --batchSize=10
where number varies depending on nature of your data. Start with 1000.
参考:
http://stackoverflow.com/questions/30566438/error-10334-bsonobj-size-is-invalid-when-importing-a-back-up-with-mongorestore
http://stackoverflow.com/questions/22213777/exception-bsonobj-size-286331154-0xeeeeeeee-is-invalid-size-must-be-betwee/33402907#33402907