使用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不稳定或总是面临分段故障问题。任何见解??
答案 0 :(得分:0)
收藏品有多大?两台服务器都有相同数量的物理内存吗? Mongo会尽可能多地将工作集存储到内存中,但是如果你正在恢复的服务器的RAM大大减少,则可能导致问题。