gpt4 book ai didi

mongodb - 导入mongodb数据库的问题

转载 作者:可可西里 更新时间:2023-11-01 09:56:08 28 4
gpt4 key购买 nike

我在使用 restore 命令导入 mongodb 数据库时遇到了一些问题。我使用普通的 mongodump 命令转储数据库,然后尝试使用 mongorestore 在我的本地服务器中恢复它。问题是,当集合中的文档数量较少时,导入会成功,但当文档数量较多时,服务器就会崩溃。下面给出了日志的堆栈跟踪

Wed May 11 16:42:14 [initandlisten] connection accepted from 127.0.0.1:50532 #35
Wed May 11 16:42:14 [FileAllocator] allocating new datafile /var/lib/mongodb/twitter.ns, filling with zeroes...
Wed May 11 16:42:14 [FileAllocator] done allocating datafile /var/lib/mongodb/twitter.ns, size: 16MB, took 0 secs
Wed May 11 16:42:14 [FileAllocator] allocating new datafile /var/lib/mongodb/twitter.0, filling with zeroes...
Wed May 11 16:42:14 [FileAllocator] done allocating datafile /var/lib/mongodb/twitter.0, size: 16MB, took 0 secs
Wed May 11 16:42:14 [FileAllocator] allocating new datafile /var/lib/mongodb/twitter.1, filling with zeroes...
Wed May 11 16:42:14 [FileAllocator] done allocating datafile /var/lib/mongodb/twitter.1, size: 32MB, took 0 secs
Wed May 11 16:42:14 [conn35] building new index on { _id: 1 } for twitter.home_timeline
Wed May 11 16:42:14 [conn35] done for 0 records 0secs
Wed May 11 16:42:14 [FileAllocator] allocating new datafile /var/lib/mongodb/twitter.2, filling with zeroes...
Wed May 11 16:42:14 [FileAllocator] done allocating datafile /var/lib/mongodb/twitter.2, size: 64MB, took 0 secs
Wed May 11 16:42:14 [conn35] building new index on { _id: 1 } for twitter.direct_messages
Wed May 11 16:42:14 [conn35] done for 0 records 0secs
Wed May 11 16:42:14 [conn35] building new index on { aves_user_id: 1.0 } for twitter.home_timeline
Wed May 11 16:42:14 [conn35] done for 3838 records 0.027secs
Wed May 11 16:42:14 [conn35] building new index on { parsed: 1.0 } for twitter.home_timeline
Wed May 11 16:42:14 [conn35] done for 3838 records 0.03secs
Wed May 11 16:42:14 [conn35] building new index on { parsed: 1.0 } for twitter.direct_messages
Wed May 11 16:42:14 Invalid access at address: 0x11dc218a

Wed May 11 16:42:14 Got signal: 11 (Segmentation fault).

谁能告诉我这背后的原因。好吧,远程服务器是 64 位 ubuntu,而我的本地服务器是 32 位 ubuntu。这可能是坠机的原因。我的意思是我刚刚使用了简单的 mongodump 和 mongorestore 就是这样,那为什么它会导致服务器崩溃。

而且我不明白; mongodb 不稳定或者它总是面临段错误问题。有什么见解吗??

最佳答案

集合有多大?两台服务器是否具有相同数量的物理内存? Mongo 会将尽可能多的工作集存储到内存中,但如果您要恢复的服务器的 RAM 显着减少,则可能会导致问题。

关于mongodb - 导入mongodb数据库的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5963166/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com