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.

已提问 2 年前613 查看次数
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
专家
已回答 2 年前
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
已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则