问题
I've deployed my Meteor app with MUPX with mongodb on the server.
MUPX puts mongodb in a docker container.
How do I back it up?
I ran the command docker exec -it mongodb mongodump
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?
回答1:
I figured it out. I had to learn more about how to use docker.
So first after running the command docker exec -it mongodb mongodump
The dump was inside the docker container.
To see running docker container type
docker ps
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 .
that will copy the dump directory into your current directory. Then just use scp to copy from to your local computer
来源:https://stackoverflow.com/questions/32793352/how-to-backup-mongodb-on-a-meteor-app-deployed-with-mupx