0

当我做 200,000 条记录的 mongo 导入时,我的一半记录只被插入,其余的被留下,但如果我导入 10,000 条记录,它们就会成功导入。我的日志的一小部分如下所示。我用 1gb ram 运行 ubuntu linux 11.04。

 Fri Jun 29 23:10:38 [conn7] insert doctor_development.alabama_nps exception: file /home/abhay/data/db/doctor_development.1 open/create failed in createPrivateMap (look in log for more information) code:13636 3ms
Fri Jun 29 23:10:38 [conn7] ERROR: mmap private failed with out of memory. (64 bit build)
Fri Jun 29 23:10:38 [conn7] Assertion: 13636:file /home/abhay/data/db/doctor_development.1 open/create failed in createPrivateMap (look in log for more information)
0x588cb2 0x75b95e 0x75c853 0x8a07cb 0x89c0e2 0x89c7c5 0x89ca3f 0x8a1b52 0x8a1d57 0x8aede9 0x8b04bb 0x8817f8 0x887371 0x889825 0xa9c576 0x638937 0x2b8a68736d8c 0x2b8a691d604d 
 ./mongod(_ZN5mongo11msgassertedEiPKc+0x112) [0x588cb2]
 ./mongod(_ZN5mongo8MongoMMF13finishOpeningEv+0x1be) [0x75b95e]
 ./mongod(_ZN5mongo8MongoMMF6createESsRyb+0x63) [0x75c853]
 ./mongod(_ZN5mongo13MongoDataFile4openEPKcib+0x14b) [0x8a07cb]
 ./mongod(_ZN5mongo8Database7getFileEiib+0x102) [0x89c0e2]
 ./mongod(_ZN5mongo8Database12suitableFileEPKcibb+0x55) [0x89c7c5]
 ./mongod(_ZN5mongo8Database11allocExtentEPKcibb+0x7f) [0x89ca3f]
 ./mongod(_ZN5mongo10outOfSpaceEPKcPNS_16NamespaceDetailsEibNS_7DiskLocE+0x112) [0x8a1b52]
 ./mongod(_ZN5mongo26allocateSpaceForANewRecordEPKcPNS_16NamespaceDetailsEib+0x77) [0x8a1d57]
 ./mongod(_ZN5mongo11DataFileMgr6insertEPKcPKvibbPb+0x4a9) [0x8aede9]
 ./mongod(_ZN5mongo11DataFileMgr16insertWithObjModEPKcRNS_7BSONObjEb+0x4b) [0x8b04bb]
 ./mongod(_ZN5mongo14checkAndInsertEPKcRNS_7BSONObjE+0xa8) [0x8817f8]
 ./mongod(_ZN5mongo14receivedInsertERNS_7MessageERNS_5CurOpE+0x441) [0x887371]
 ./mongod(_ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_11HostAndPortE+0x1155) [0x889825]
 ./mongod(_ZN5mongo16MyMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortEPNS_9LastErrorE+0x76) [0xa9c576]
 ./mongod(_ZN5mongo3pms9threadRunEPNS_13MessagingPortE+0x287) [0x638937]
 /lib/x86_64-linux-gnu/libpthread.so.0(+0x6d8c) [0x2b8a68736d8c]
 /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x2b8a691d604d]
Fri Jun 29 23:10:38 [conn7] insert doctor_development.alabama_nps exception: file /home/abhay/data/db/doctor_development.1 open/create failed in createPrivateMap (look in log for more information) code:13636 3ms
Fri Jun 29 23:10:38 [conn7] ERROR: mmap private failed with out of memory. (64 bit build)
Fri Jun 29 23:10:38 [conn7] Assertion: 13636:file /home/abhay/data/db/doctor_development.1 open/create failed in createPrivateMap (look in log for more information)
0x588cb2 0x75b95e 0x75c853 0x8a07cb 0x89c0e2 0x89c7c5 0x89ca3f 0x8a1b52 0x8a1d57 0x8aede9 0x8b04bb 0x8817f8 0x887371 0x889825 0xa9c576 0x638937 0x2b8a68736d8c 0x2b8a691d604d 
 ./mongod(_ZN5mongo11msgassertedEiPKc+0x112) [0x588cb2]
 ./mongod(_ZN5mongo8MongoMMF13finishOpeningEv+0x1be) [0x75b95e]
 ./mongod(_ZN5mongo8MongoMMF6createESsRyb+0x63) [0x75c853]
 ./mongod(_ZN5mongo13MongoDataFile4openEPKcib+0x14b) [0x8a07cb]
 ./mongod(_ZN5mongo8Database7getFileEiib+0x102) [0x89c0e2]
 ./mongod(_ZN5mongo8Database12suitableFileEPKcibb+0x55) [0x89c7c5]
 ./mongod(_ZN5mongo8Database11allocExtentEPKcibb+0x7f) [0x89ca3f]
 ./mongod(_ZN5mongo10outOfSpaceEPKcPNS_16NamespaceDetailsEibNS_7DiskLocE+0x112) [0x8a1b52]
 ./mongod(_ZN5mongo26allocateSpaceForANewRecordEPKcPNS_16NamespaceDetailsEib+0x77) [0x8a1d57]
 ./mongod(_ZN5mongo11DataFileMgr6insertEPKcPKvibbPb+0x4a9) [0x8aede9]
 ./mongod(_ZN5mongo11DataFileMgr16insertWithObjModEPKcRNS_7BSONObjEb+0x4b) [0x8b04bb]
 ./mongod(_ZN5mongo14checkAndInsertEPKcRNS_7BSONObjE+0xa8) [0x8817f8]
 ./mongod(_ZN5mongo14receivedInsertERNS_7MessageERNS_5CurOpE+0x441) [0x887371]
 ./mongod(_ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_11HostAndPortE+0x1155) [0x889825]
 ./mongod(_ZN5mongo16MyMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortEPNS_9LastErrorE+0x76) [0xa9c576]
 ./mongod(_ZN5mongo3pms9threadRunEPNS_13MessagingPortE+0x287) [0x638937]
 /lib/x86_64-linux-gnu/libpthread.so.0(+0x6d8c) [0x2b8a68736d8c]
 /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x2b8a691d604d]
4

2 回答 2

0

这不是最好的答案,但它奏效了。我使用了 mongodb 2.0.6,它给出了上面提到的各种错误,但是当我将它降级到 1.8.5 时,它就像魅力一样。

于 2012-07-02T04:49:47.793 回答
0

对我来说,问题是 32 位系统中的 2gb 限制:http: //blog.mongodb.org/post/137788967/32-bit-limitations

于 2012-09-30T16:39:16.230 回答