我正在尝试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文档的单个集合,这是我所期望的,平均大小和其他元数据显然是正确的,但对此一无所知。
我已经从活动集群中导出了数据库,并想导入到我的本地开发环境中,并通过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
谢谢你!你救了我的一天!同样的问题!