[Mongo] error inserting documents: BSONObj size is invalid (mongoimport mongorestore 数据备份恢复)
解决办法如下, ./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
[Mongo] error inserting documents: BSONObj size is invalid (mongoimport mongorestore 数据备份恢复)的更多相关文章
- insmod: error inserting 'simp-blkdev.ko': -1 Invalid module format
(一) 今天写了个块设备驱动例子,在虚拟机上加载模块insmod simp_blkdev.ko的时候,出现以下错误. insmod: error inserting 'simple-blk.ko': ...
- 解决insmod: error inserting 'hello.ko': -1 Invalid module format
编译自己的内核模块后,insmod出现error:error inserting 'hello.ko': -1 Invalid module format 出现这种情况的原因是因为Makefile种使 ...
- insmod: error inserting 'hello.ko': -1 Invalid module format
在学习编写linux驱动程序的时候,一般都是从写一个helloworld的模块開始. 可是在编译完毕后,进行模块载入的时候,有时会出现例如以下错误: insmod: error inserting ' ...
- 空间索引网格大小无效的解决方法The spatial index grid size is invalid
原名引至:http://www.cnblogs.com/linhugh/archive/2012/07/24/2606439.html 之前在做shp数据导入Geodatabase中时,程序运行出 ...
- PhpStorm和WAMP配置调试参数,问题描述Error. Interpreter is not specified or invalid. Press “Fix” to edit your project configuration.
PhpStorm和WAMP配置调试参数 问题描述: Error. Interpreter is not specified or invalid. Press “Fix” to edit your p ...
- 502 Proxy Error The proxy server received an invalid response from an upstream server
Proxy Error The proxy server received an invalid response from an upstream server. The proxy server ...
- IAR 编译错解决Error[e16]: Segment NEAR_Z (size: 0x16d align: 0) is too long for segment definition. At least 0x83 more bytes needed.
Error[e16]: Segment NEAR_Z (size: 0x16d align: 0) is too long for segment definition. At least 0x83 ...
- PhpStorm和WAMP配置调试参数,问题描述Error. Interpreter is not specified or invalid. Press “Fix” to edit your project configuration.
PhpStorm和WAMP配置调试参数,解决实际问题. 问题描述: Error. Interpreter is not specified or invalid. Press "Fix&qu ...
- linux环境,通过rpm删除mysql包,报错:error reading information on service mysqld: Invalid argument
问题描述: 今天在做saltstack的练习,想要通过sls的方式,在远程进行mysql数据库的安装,发现无法通过service的方式启动数据库,然后就想给删除了重新进行安装,在通过rpm -e进行删 ...
随机推荐
- 万网域名解析到IP地址
进入https://home.console.aliyun.com/#/的阿里云控制台 再自己购买的域名列表里进行操作 添加一个A解析
- HDU 2669 第六周 I题
Description The Sky is Sprite. The Birds is Fly in the Sky. The Wind is Wonderful. Blew Throw the ...
- 阿里云mysql数据库恢复总结,mysql binlog日志解析
由于意外..阿里云mysql中有一张表被全部删除了,深吸三口气候,开始解决. 首先用凌晨的自动备份的,进行全量恢复,然后找binlog日志(见下文),查找从全量备份到数据删除之间的记录 这导致了一个问 ...
- Linux C C语言库的创建和调用
C语言库的创建和调用 简介: 假如,你有一个庞大的工程,代码量达到数百兆甚至是数G,你经常会遇到好多重复或常用的地方.每次使用到这些地方时如果都重新写一份基本相同的代码,这当然可以,不过这样会大大地降 ...
- Asp.Net生命周期系列二
在上回书开始的时候我们提到博客园的IIS看了一眼我的请求后就直接交给ASP.NET去处理了,并且要求ASP.NET处理完之后返回HTML以供展示. 那么我们不仅要问: 1, IIS肯定是没有眼睛 ...
- Careercup - Facebook面试题 - 5177378863054848
2014-05-02 08:29 题目链接 原题: Write a function for retrieving the total number of substring palindromes. ...
- NYOJ-36 最长公共子序列 AC 分类: NYOJ 2014-01-03 20:54 155人阅读 评论(0) 收藏
#include<stdio.h> #include<string.h> #define N 1010 #define max(x,y) x>y?x:y int dp() ...
- rsync 文件校验及同步原理及rsync server配置
参考:http://rsync.samba.org/how-rsync-works.html 我们关注的是其发送与接收校验文件的算法,这里附上原文和我老婆(^_^)的翻译: The Sender Th ...
- HDU 3047 Zjnu Stadium(带权并查集)
题意:有一个环形体育场,有n个人坐,给出m个位置关系,A B x表示B所在的列在A的顺时针方向的第x个,在哪一行无所谓,因为假设行有无穷个. 给出的座位安排中可能有与前面矛盾的,求有矛盾冲突的个数. ...
- HDU 1598 find the most comfortable road(枚举+并查集,类似于最小生成树)
一开始想到用BFS,写了之后,发现有点不太行.网上查了一下别人的解法. 首先将边从小到大排序,然后从最小边开始枚举,每次取比它大的边,直到start.end属于同一个集合,即可以连通时停止.过程类似于 ...