0

尝试在 MongoDB 中恢复 32GB 数据库时出现错误。我已经尝试了以下命令,但它们都不起作用:

mongorestore --db prod --drop --dir backup-cloud-server/20200221020001/prod --batchSize=1

mongorestore --db prod --drop --dir backup-cloud-server/20200221020001/prod --batchSize=10

mongorestore --db prod --drop --dir backup-cloud-server/20200221020001/prod --batchSize=100

mongorestore --db prod --drop --dir backup-cloud-server/20200221020001/prod --batchSize=1000

    [#######################.]  DbName.CollectionName  31.4 GB/32.2 GB  (98.7%)
    [#######################.]  DbName.CollectionName  31.7 GB/32.2 GB  (99.0%)
    [#######################.]  DbName.CollectionName  32.9 GB/32.2 GB  (99.3%)
    [#######################.]  DbName.CollectionName  32.1 GB/32.2 GB  (99.5%)
    [#######################.]  DbName.CollectionName  32.2 GB/32.2 GB  (99.8%)
    restoring indexes for collection DbName.CollectionName from metadata
    Failed: restore error: DbName.CollectionName: error creating indexes for DbName.CollectionName: createIndex error: EOF

我还尝试根据此建议https://groups.google.com/forum/#!msg/mongodb-user/Ms2MXCajreg/OsW6ixcSCgAJ将wiredTiger cachedSize 更改为4GB,但它没有奏效。

有什么建议吗?

我的机器/环境:

操作系统:MAC OS X 10.14.6

内存:32GB

可用磁盘:80GB

蒙戈版本:v4.2.2

mongorestore 版本:r4.2.2

编辑:这里有--noIndexRestore国旗

2020-03-05T14:43:06.588+0100    [#######################.]  dbname.CollectionName  31.7GB/32.2GB  (98.5%)
2020-03-05T14:43:09.588+0100    [#######################.]  dbname.CollectionName  31.9GB/32.2GB  (99.1%)
2020-03-05T14:43:12.588+0100    [#######################.]  dbname.CollectionName  32.1GB/32.2GB  (99.8%)
2020-03-05T14:43:13.286+0100    [########################]  dbname.CollectionName  32.2GB/32.2GB  (100.0%)
2020-03-05T14:43:13.286+0100    finished restoring dbname.CollectionName (12660301 documents, 0 failures)
2020-03-05T14:43:13.286+0100    Failed: dbname.CollectionName: error restoring from backup/20200221020001/dbname/CollectionName.bson: reading bson input: unexpected EOF
2020-03-05T14:43:13.286+0100    12667254 document(s) restored successfully. 0 document(s) failed to restore.
4

0 回答 0