解决办法如下, ./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 数据备份恢复)的更多相关文章

  1. insmod: error inserting 'simp-blkdev.ko': -1 Invalid module format

    (一) 今天写了个块设备驱动例子,在虚拟机上加载模块insmod simp_blkdev.ko的时候,出现以下错误. insmod: error inserting 'simple-blk.ko': ...

  2. 解决insmod: error inserting 'hello.ko': -1 Invalid module format

    编译自己的内核模块后,insmod出现error:error inserting 'hello.ko': -1 Invalid module format 出现这种情况的原因是因为Makefile种使 ...

  3. insmod: error inserting 'hello.ko': -1 Invalid module format

    在学习编写linux驱动程序的时候,一般都是从写一个helloworld的模块開始. 可是在编译完毕后,进行模块载入的时候,有时会出现例如以下错误: insmod: error inserting ' ...

  4. 空间索引网格大小无效的解决方法The spatial index grid size is invalid

    原名引至:http://www.cnblogs.com/linhugh/archive/2012/07/24/2606439.html   之前在做shp数据导入Geodatabase中时,程序运行出 ...

  5. 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 ...

  6. 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 ...

  7. 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 ...

  8. 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 ...

  9. linux环境,通过rpm删除mysql包,报错:error reading information on service mysqld: Invalid argument

    问题描述: 今天在做saltstack的练习,想要通过sls的方式,在远程进行mysql数据库的安装,发现无法通过service的方式启动数据库,然后就想给删除了重新进行安装,在通过rpm -e进行删 ...

随机推荐

  1. hdu 5545 The Battle of Guandu spfa最短路

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5545 题意:有N个村庄, M 个战场: $ 1 <=N,M <= 10^5 $; 其中曹 ...

  2. Fat-tree 胖树交换网络

    胖树架构下,网络带宽不收敛 传统的树形网络拓扑中,带宽是逐层收敛的,树根处的网络带宽要远小于各个叶子处所有带宽的总和. 而胖树网络则更像是真实的树,越到树根,枝干越粗,即:从叶子到树根,网络带宽不收敛 ...

  3. mouse_driver

    1:function.h #ifndef FUNCTION_H#define FUNCTION_H #define DRIVER_FUNCTION_ADD_DEVICE#define DRIVER_F ...

  4. snmptrap使用

    SNMP简单网络管理协议,其中其支持的一个命令snmptrap命令,用于模拟向管理机发送trap消息.   启动陷阱方法: snmptrapd -C -c /etc/snmp/snmptrapd.co ...

  5. 关于JS的一些代码效果图

    关于JS的一些代码效果图 1.几乎所有DOM元素都有innerText.innerHTML属性(注意大小写),分别是元素标签内内容的文本表示形式和HTML源代码,这两个属性是可读可写的. 需要注意的是 ...

  6. 在云服务器搭建WordPress博客(二)使用xampp并解决端口冲突问题

    要搭建一台外界可以访问的服务器,就必须有对应的服务器环境.在这里我用的xampp集成环境(我是菜鸟级......),xampp集成了PHP+Apache+MySQL+perl,安装方便,不用再特意去设 ...

  7. The 10th Zhejiang Provincial Collegiate Programming Contest

    Applications http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5008 string set 专场 #include& ...

  8. display:none和visibility: hidden二三事

    display:none属性后,HTML元素(对象)的宽度.高度等各种属性值都将“丢失”;而使用visibility:hidden属性后,HTML元素(对象)仅仅是在视觉上看不见(完全透明),而它所占 ...

  9. Codeforces Round #363 (Div. 2)->C. Vacations

    C. Vacations time limit per test 1 second memory limit per test 256 megabytes input standard input o ...

  10. Eclipse和intellij idea 快捷键对比

    Eclipse和intellij idea 快捷键对比