[Mongo] error inserting documents: BSONObj size is invalid (mongoimport mongorestore 数据备份恢复)
2016-02-26 16:35
786 查看
解决办法如下, ./mongoimport -port 6066 -d xxx -c xxx --batchSize=10 /root/mong_data/test/xxx
原因转自 http://blog.csdn.net/xiaobluesky/article/details/50216927
从MONGODB2.6升级到MONGODB3.0.7,从MONGODB3.0 RESTORE 2.6DUMP的文件时,报如下错误: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) GOOGLE之后看到解决方案 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.
--------------------------------------------------------------------------------------------
alternatively you can use the 3.0.7 version of mongorestore as long as you pass a smallish batch size. The actual value depends on your document sizes, so I can't give you an actual recommended value. The default, what's being used if you don't specify anything, is 10,000.You could try --batchSize=1000 and see if that works for you. If that still fails, you could halve that value until it succeeds.
--------------------------------------------------------------------------------------------------------------------------------
mongorestore send insert commands by batch in a {"applyOps", entries} document. This document is (AFAIK) limited to 16MB just like any other document.According to the sources there are "pathological cases where the array overhead of many small operations can overflow the maximum command size". The variable oplogMaxCommandSize is used to help mongorestore to not fail on such cases. It was raised to 16.5M at some point during the 3.0... development. That was too optimistic. It was lowered back to 8M later (JIRA TOOLS-754).If you need to, you may adjust that value yourself according to your needs. And then recompile the tools.
-------------------------------------
官方BUG链接:https://jira.mongodb.org/browse/TOOLS-939
原因转自 http://blog.csdn.net/xiaobluesky/article/details/50216927
从MONGODB2.6升级到MONGODB3.0.7,从MONGODB3.0 RESTORE 2.6DUMP的文件时,报如下错误: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) GOOGLE之后看到解决方案 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.
--------------------------------------------------------------------------------------------
alternatively you can use the 3.0.7 version of mongorestore as long as you pass a smallish batch size. The actual value depends on your document sizes, so I can't give you an actual recommended value. The default, what's being used if you don't specify anything, is 10,000.You could try --batchSize=1000 and see if that works for you. If that still fails, you could halve that value until it succeeds.
--------------------------------------------------------------------------------------------------------------------------------
mongorestore send insert commands by batch in a {"applyOps", entries} document. This document is (AFAIK) limited to 16MB just like any other document.According to the sources there are "pathological cases where the array overhead of many small operations can overflow the maximum command size". The variable oplogMaxCommandSize is used to help mongorestore to not fail on such cases. It was raised to 16.5M at some point during the 3.0... development. That was too optimistic. It was lowered back to 8M later (JIRA TOOLS-754).If you need to, you may adjust that value yourself according to your needs. And then recompile the tools.
-------------------------------------
官方BUG链接:https://jira.mongodb.org/browse/TOOLS-939
相关文章推荐
- CodeForces 616 D. Longest k-Good Segment(尺取)
- django使用rest_framework
- django book的第一个例子
- Altium Designer AD6 AD9 DXP 制作公司LOGO终极大招,大小随意放置
- golang strconv
- 【转载】Google Analytics 使用图文全攻略
- gomobile 真机 log 打出的日志跟踪
- 原创翻译:James Whittaker系列——Google是如何测试的(3)
- 用goto语句 百钱百鸡。公鸡5元一只,母鸡3元一只,小鸡1元3只。求100元分别能买多少公鸡、母鸡、小鸡。
- golang实现抽象工厂模式
- Django开发常用的模块
- UVA 1623(p256)----Enter the Dragon
- golang实现常用排序算法
- UVa Dragon of Loowater 11292 (贪心)
- 关于python django-admin.py startproject mysite不工作的问题
- ionic 设置logo 与 设置 启动页
- 分布式基础通信协议:paxos,totem和gossip
- Google欲争夺新闻入口 “ 即时文章”正式上线
- lnmp 用mongo
- 为visual studio code配置go开发环境(windows)