简体   繁体   中英

MongoDB backup strategy for AWS

If I have mongodb running in an EC2 instance that is being written to (somewhat) constantly what is the most intelligent, safe, and inexpensive backup strategy.

My concern is that if an EC2 instance goes down you lose any data written to disk...

Old question but I think that I can contribute with more details and informations about a real success case.

In a production environment I have 3 Mongodb with replicaset running in 3 T2.micro instances, 1 instance is the primary, 1 instance is the secondary and 1 instance is delayed (every 4 hours is synchronized) with persistent EBS (it's not deleted after instance reboot). Every 4.5 hours I start a Lambda process that makes a EBS snapshot of delayed instance and sends to a S3 bucket. This is working pretty well.

Some links that can help:

Who better than 10gen (MongoDB developers) to responds you.

You can see in follogin site, official documentation about MongoDB backups in EC2 instances. http://docs.mongodb.org/ecosystem/platforms/amazon-ec2/

They suggest an EBS snapshots. This solution permits start instance in a few of seconds with a "photo" of your database.

我们使用(至少两个)Linux 实例,其数据存储在 EBS 和副本集(http://www.mongodb.org/display/DOCS/Replica+Sets)上。

You can follow the link https://gist.github.com/eladnava/96bd9771cd2e01fb4427230563991c8d

It has different type of solution for different requirement

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM