[英]Mongorestore in docker failed: Failed: gzip: invalid header
I created a mongo dump with commands (as suggested in this answer )我用命令创建了一个 mongo 转储(如这个答案中所建议的)
docker exec -it mongodb bash
mongodump --host $cluster --ssl --username $username --authenticationDatabase admin --db $dbname --gzip --archive > dumpname.gz
Now when I'm trying to restore the dump with现在,当我尝试使用以下命令恢复转储时
docker exec mongodb bash -c 'mongorestore --gzip --archive=dumpname.gz'
I get我得到
Failed: gzip: invalid header失败:gzip:无效的标头
It seems like there is some bug with using redirection ( >
).使用重定向( >
)似乎存在一些错误。 So when I changed the first command to not use it, mongorestore
started to work:因此,当我将第一个命令更改为不使用它时, mongorestore
开始工作:
mongodump --host $cluster --ssl --username $username --authenticationDatabase admin --db $dbname --gzip --archive=dumpname.gz
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.