Mongodb 蒙哥里斯托雷无限期地被吊死

Mongodb 蒙哥里斯托雷无限期地被吊死,mongodb,backup,mongorestore,Mongodb,Backup,Mongorestore,我正在尝试使用mongorestore从gzip文件还原数据库。数据库大小约为89MB,gzip文件约为4.4MB 但是,还原将无限期挂起,并且不会显示错误消息。我应该如何对此进行故障排除 我运行的命令是: mongorestore --gzip --archive ./my-db.gz --drop -u admin --authenticationDatabase admin --verbose=5 因此,答案是: 2018-01-09T15:47:45.089+0100 stand

我正在尝试使用
mongorestore
从gzip文件还原数据库。数据库大小约为89MB,gzip文件约为4.4MB

但是,还原将无限期挂起,并且不会显示错误消息。我应该如何对此进行故障排除

我运行的命令是:

mongorestore --gzip --archive ./my-db.gz --drop -u admin --authenticationDatabase admin --verbose=5
因此,答案是:

2018-01-09T15:47:45.089+0100    standard input is a terminal; reading password from terminal
Enter password:

2018-01-09T15:47:46.508+0100    will listen for SIGTERM, SIGINT, and SIGKILL
2018-01-09T15:47:46.509+0100    checking options
2018-01-09T15:47:46.509+0100        dumping with object check disabled
2018-01-09T15:47:46.527+0100    connected to node type: standalone
2018-01-09T15:47:46.528+0100    standalone server: setting write concern w to 1
2018-01-09T15:47:46.528+0100    using write concern: w='1', j=false, fsync=false, wtimeout=0
在这里,它永远停止。数据库已成功创建,但大小仍为
0b

奇怪的是,MongoDB Compass中的数据库概述显示了数据库中的单个集合有约28k个文档,这正是我所期望的,平均大小和其他元数据显然是正确的,但无法读取

我已经从一个实时集群导出了db,并试图导入到我的本地开发环境中,通过Docker运行一个实例

我应该从这里去哪里

谢谢。

我找到了解决办法

如果使用
--archive./my db.gz
运行命令,就会出现死锁。如果我执行
--archive=./my db.gz
,它将正确恢复(即需要等号)

我正在运行MacOSX High Sierra(10.13.2),并从brew安装MongoDB;版本:

mongorestore version: r3.4.1
git version: 4a0fbf5245669b55915adf7547ac592223681fe1
Go version: go1.7.5
   os: darwin
   arch: amd64
   compiler: gc
OpenSSL version: OpenSSL 1.0.2k  26 Jan 2017

看起来这是正确的行为,虽然很奇怪

因此,程序正在等待归档文件通过管道传输到标准输入

所以它可以这样工作

mongorestore --gzip --archive=./my-db.gz --drop -u admin --authenticationDatabase admin --verbose=5

mongorestore--gzip--archive--drop-u admin--authenticationDatabase admin--verbose=5
对我来说,这该死的东西在大约5分钟内停留在某个百分比,然后自行增加。不知道为什么:/网络活动很好,磁盘也很好。不知道如何进一步调试。

谢谢!你救了我一天!同样的问题!
mongorestore --gzip --archive=./my-db.gz --drop -u admin --authenticationDatabase admin --verbose=5
mongorestore --gzip --archive --drop -u admin --authenticationDatabase admin --verbose=5 < my-db.gz