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개 답변
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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠