简体   繁体   中英

Best option to take complete Backup of EC2 instance?

Currently I am taking manual backup of our EC2 instance by zipping the data and downloading it locally as well as on DropBox.

But I am wondering, can I have an option where I just take a complete copy of the whole system automatically daily so if something goes wrong/crashes, I can replace it with previous copy immediately rather than spending hours installing and configuring things ?

I can see there is an option of take "Image" but can I automated them to have just 1 latest image and replace the system with single click ?

You can create a single Image of your instance as Backup of your instance Configuration.

And

To keep back up of your data you can use snapshots of your volumes. snapshots store data in incremental format whenever you make any changes. When ever needed you can just attach the volume from the snapshot to your Instance.

It is not a good idea to do "external backup" for EC2 instance snapshot, before you read AWS pricing details.

First, AWS is charging every GB of data your transfer OUTside AWS cloud. Check out this pricing . Generally speaking, after the 1st GB, the rest will be charge at least $0.09/GB, against S3-standard pricing ~ $0.023/GB.

Second, the snapshot created is actually charges as S3 pricing( Check : Copying an Amazon EBS Snapshot ), not EBS pricing. After offset the transfer cost, perhaps you should consider create multiple snapshot than keep doing the data transfer out backup.

HOWEVER, if you happens to use an instance that use ephemeral storage, snapshot will not help. You need to copy the data out from ephemeral storage yourself. Then it is your choice to store under S3 or other place.

Third. If you worry the AWS region going down, check the multiple AZ option. Or checkout alternate AWS region option.

Fourth. When storing backup data in S3, you can always store them under Infrequent-Access, which save you some bucks, and you don't need to face an insane Glacier bills during emergency restore(Avoid Glacier, unless you are pretty sure about your own requirement).

Fifth, after done your plan of doing everything inside AWS, you can write bash script (AWS CLI) or use boto3, etc API to do the automatic backup.

Lastly , here is way of AWS create and maintain snapshot . Though each snapshot are deem "incremental", when u delete old snap shot :

the snapshot deletion process is designed so that you need to retain only the most recent snapshot in order to restore the volume.

You can always "test" restore by create another EC2 instance that load the backup snapshot. Or you can mount the snapshot volume from another EC2 instance to check the contents.

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