Reputation: 41909
Given this VPC diagram from AWS:
Let's say that a web service is running on that ec2 instance with the Elastic IP Address
(EIP).
If that ec2 instance terminates, then, as I understand, the web service will no longer be running.
Since ELB's cannot have EIPS, as this AWS post explains, how can the above diagram be changed to ensure fault tolerance, i.e. what an ELB would do?
In the above diagram, what can be done to ensure reliability in case the ec2 instance dies? Can an ELB be used? If so, where?
Upvotes: 0
Views: 98
Reputation: 450
The standard set up would probably be an ELB and an ASG (auto-scaling group) to achieve fault tolerance and high-availability. In your diagram, the ASG would go around the EC2s and then the ELB would around that. Docs: https://aws.amazon.com/autoscaling/
The ASG would be configured to keep up X EC2 instances up so if one goes down, the ASG is responsible for bringing a new one up. Health checks will ensure that the ELB routes traffic to only healthly EC2 instances. E.g. if your EC2 instance is in the process of dying or coming up, traffic wouldn't be routed to it so users wouldn't notice.
Each EC2 should be in a different availability zone (AZ) e.g "a", "b" and "c" (or "a" and "b" if the region has two AZs). Docs: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html
Upvotes: 3