【发布时间】:2020-09-07 08:44:41
【问题描述】:
我从包含 65.8M 记录的服务器中提取了一个记录转储,总 DB 记录为 74M。它为此数据库生成了大约 4.26GB 的 gzip。
当我在我的一台本地机器上下载这个 gzip.archive 转储文件时,它具有 Windows 和 mongorestore。它成功运行并恢复了所有数据,但是在恢复索引时它给了我以下异常
Failed: leads.business: error creating indexes for leads.business: createIndex error: connection(localhost:27017[-5]) unable to decode message length: read tcp 127.0.0.1:51636->127.0.0.1:27017: i/o timeout
2020-05-21T00:15:23.128+0500 74181602 document(s) restored successfully. 0 document(s) failed to restore.
所以我搜索了这个异常,发现这个问题已经在 MongoDB JIRA 票证中得到修复是https://jira.mongodb.org/browse/TOOLS-2394。
然后我尝试将相同的转储恢复到具有最新 MongoDB 版本的 ubuntu 机器上。它没有给我任何例外,但似乎被绞死了。我等了半个多小时,甚至比完整的数据库恢复时间还要长。但是 mongorestore 从未响应光标一直在闪烁,好像正在处理某些事情但没有发生任何事情。我在 ubuntu 上试过两次。
重要信息:
MongoDB 服务器详情:
OS: Ubuntu
Description: Ubuntu 18.04.3 LTS
Release: 18.04
Codename: bionic
MongoDB Version: 4.2.6
MongoDB 本地机器详细信息:
OS: Windows 10
MongoDB Version: 4.2.0
MongoDB 本地机器详细信息:
OS: Ubuntu
Description: Ubuntu 20.04 LTS
Release: 20.04
Codename: Focal Fossa
MongoDB Version: 4.2.6
在使用 MongoDB 4.2.6 更新 Windows 机器以避免出现异常后,我根据票证 https://jira.mongodb.org/browse/TOOLS-2394
日志:
2020-05-21T04:04:16.107+0500 leads.business 27.6GB
2020-05-21T04:04:18.835+0500 leads.business 27.7GB
2020-05-21T04:04:18.849+0500 restoring indexes for collection leads.business from metadata
可以看出,它从 2020-05-21T04:04:18.849+0500 开始恢复索引,现在已经过去了将近一个小时的 4:54
如果其他人遇到此问题,请分享您的想法。谢谢!
【问题讨论】:
标签: mongodb mongodump mongorestore