【问题标题】:problems in importing mongodb database导入mongodb数据库的问题
【发布时间】:2011-08-23 05:15:54
【问题描述】:

我在使用 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 不稳定或者它总是面临分段错误问题。有什么见解吗??

【问题讨论】:

  • 这不是你在同一时间问的stackoverflow.com/questions/5959775/mongodb-shutting-down 的骗子吗?
  • 其实我只是想知道当转储的mongodb数据来自64位mongodb时,将数据恢复到32位ubuntu时是否会出现任何问题
  • 除非您正在导入的内容和现有数据加起来超过 2 GB,否则不会。
  • 顺便说一句,请查看您在我试图回答的地方发布的重复问题。
  • lobster1234,我发现当它尝试导入特定集合的索引时会出现问题。休息就好。您能否提供一些见解,为什么会这样。我已将 mongodb 升级到 1.8.1 版本。它在该特定位置引发分段错误

标签: mongodb


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-01-27
    • 2014-01-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-30
    • 2023-03-29
    • 1970-01-01
    相关资源
    最近更新 更多