我生成了一个具有该archivegz
格式的 MongoDB 转储文件。当我尝试使用mongorestore
命令恢复它时,它不会恢复。
恢复命令
mongorestore --gzip --archive="./mongo_device.bing.com_20220209-000000.archivegz" --db=Test --verbose
结果
2022-02-10T11:57:02.955+0330 using write concern: &{majority false 0}
2022-02-10T11:57:03.587+0330 will listen for SIGTERM, SIGINT, and SIGKILL
2022-02-10T11:57:03.588+0330 connected to node type: standalone
2022-02-10T11:57:03.588+0330 The --db and --collection flags are deprecated for this use-case; please use --nsInclude instead, i.e. with --nsInclude=${DATABASE}.${COLLECTION}
2022-02-10T11:57:03.740+0330 archive prelude Logger.logs
2022-02-10T11:57:03.740+0330 archive prelude Logger.DeviceChannelData
2022-02-10T11:57:03.740+0330 archive format version "0.1"
2022-02-10T11:57:03.740+0330 archive server version "4.4.3"
2022-02-10T11:57:03.740+0330 archive tool version "v3.15.0_alpha20210804-4411-g6ef8a4d4d7"
2022-02-10T11:57:03.741+0330 preparing collections to restore from
2022-02-10T11:57:03.741+0330 skipping restoring Logger.logs, it is not included
2022-02-10T11:57:03.741+0330 skipping restoring Logger.logs metadata, it is not included
2022-02-10T11:57:03.742+0330 skipping restoring Logger.DeviceChannelData, it is not included
2022-02-10T11:57:03.742+0330 skipping restoring Logger.DeviceChannelData metadata, it is not included
2022-02-10T11:57:04.208+0330 demux finishing (err:<nil>)
2022-02-10T11:57:04.208+0330 received from namespaceChan
2022-02-10T11:57:04.208+0330 restoring up to 4 collections in parallel
2022-02-10T11:57:04.208+0330 building indexes up to 4 collections in parallel
2022-02-10T11:57:04.208+0330 0 document(s) restored successfully. 0 document(s) failed to restore.
2022-02-09T13:50:42.321+0330 preparing collections to restore from
2022-02-09T13:50:42.755+0330 0 document(s) restored successfully. 0 document(s) failed to restore.
我的错误是错误地设置了
--db
标志。当标志被删除时,mongorestore
恢复数据。使用如下所述的命令。