如何在使用 MUPX 部署的流星应用程序上备份 mongodb [英] How to backup mongodb on a meteor app deployed with MUPX
问题描述
我已经在服务器上使用 MUPX 和 mongodb 部署了我的 Meteor 应用程序.
I've deployed my Meteor app with MUPX with mongodb on the server.
MUPX 将 mongodb 放在一个 docker 容器中.
MUPX puts mongodb in a docker container.
如何备份?
我运行了命令 docker exec -it mongodb mongodump
它看起来像是进行了转储.但是当我输入 ls
时,我看不到任何文件.我认为它转储了 docker 容器内的文件.
and it looked like it did a dump. but when I type ls
I don't see any files. I think it dumped the files inside the docker container.
如何访问服务器上的转储文件?然后将它们传输到我的本地计算机?
How can I access the dump files on my server? And then transfer them to my local computer?
推荐答案
我想通了.我必须更多地了解如何使用 docker.
I figured it out. I had to learn more about how to use docker.
所以先运行命令 docker exec -it mongodb mongodump
So first after running the command docker exec -it mongodb mongodump
转储在 docker 容器内.
The dump was inside the docker container.
查看正在运行的docker容器类型
To see running docker container type
docker ps
使用命令查看容器中名为mongodb的文件
Check out the files in the container with name mongodb by using command
docker exec -it mongodb ls
您将看到转储目录.要将其复制到容器外部,到您的服务器使用
You will see the dump directory. To copy it over to outside the container, to your server use
docker cp mongodb:dump .
这会将转储目录复制到您的当前目录中.然后只需使用 scp 复制到您的本地计算机
that will copy the dump directory into your current directory. Then just use scp to copy from to your local computer
这篇关于如何在使用 MUPX 部署的流星应用程序上备份 mongodb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!