How to take an ec2 consistent snapshot of a mongodb database on an amazonaws ubuntu instance using docker.
ssh -i key-pair.pem [email protected]
sudo su
docker run --name sync_mongo -d mongo
docker run -it -e AWS_ACCESS_KEY_ID=accesskey -e AWS_SECRET_ACCESS_KEY=secretaccesskey --volumes-from sync_mongo --link sync_mongo:mongo synctree/ec2-consistent-snapshot bin/bash
ec2-consistent-snapshot --mongo --mongo-host $MONGO_PORT_27017_TCP_ADDR --mongo-port $MONGO_PORT_27017_TCP_PORT vol-volumeId
result: snap-somenumber
-the volumeId is the id of the volume that has the aws instance and the snap-somenumber is the id of the snapshot
Thats it!
Content type
Image
Digest
sha256:e1f94c1c8…
Size
216.6 MB
Last updated
almost 11 years ago
docker pull synctree/ec2-consistent-snapshot