- 최신
- 최다 투표
- 가장 많은 댓글
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;
- Scale-out event, new instance will have empty data. You need to fill the instance with the data.
- 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.
Check this page to learn more https://docs.aws.amazon.com/efs/latest/ug/how-it-works.html
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
관련 콘텐츠
- 질문됨 2달 전
- AWS 공식업데이트됨 5달 전
- AWS 공식업데이트됨 5달 전
- AWS 공식업데이트됨 일 년 전