EC2 Autoscaling

0

I have a question. I'm running my entire infrastructure in EC2. If I autoscale it 1st step is to create an AMI. But after taking creating an image. How should I capture and save my live data from user. Autoscaling is working fine but how should I save the data. I'm new to it. Please, If anyone have an idea please help.

已提問 1 年前檢視次數 433 次
2 個答案
0

Hi Devashish Rokshit

My understanding is you want to capture and save the live data.

What you want to know is how to save the data. I am quite not sure about the quesiton. But let me assume there are two scenario;

  1. Scale-out event, new instance will have empty data. You need to fill the instance with the data.
  2. Scale-in event, existing instance will be removed. You need to save the data before the instance terminated.

Either scenario, the best approach is using EFS. EFS is storage living on network (VPC). you can mount EFS drive on multiple instance under Autoscaling group. This way, you don't have to worry about scaling event. Enter image description here

Check this page to learn more https://docs.aws.amazon.com/efs/latest/ug/how-it-works.html

profile pictureAWS
專家
Resa
已回答 1 年前
0

EFS as described above would definitely work but it may be costly compared to EBS volumes. You can also take advantage of lifecycle hooks. You can define a specific procedure before scaling-out ( copy data to another storage solution or S3 bucket ). You can have this lifecycle hooks for scale - in or out meaning that you can even copy data or run a script before scale-in and before your instance comes in-service.

Summary of how it works: An Amazon EC2 instance transitions through different states from the time it launches until it is terminated. You can create lifecycle hooks to act when an instance transitions into a wait state. The lifecycle hook puts the instance into a wait state (Pending:Wait) and then performs a custom action. https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks-overview.html

AWS
mojtoth
已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南