Module6 HA PDF
Module6 HA PDF
Module6 HA PDF
Introduction
Reserved Instances
https://aws.amazon.com/ec2/purchasingoptions/reservedinstances/
Elastic IP address
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elasticipaddresseseip.html
Elastic Load Balancer
https://aws.amazon.com/elasticloadbalancing/
AutoScaling group
https://aws.amazon.com/autoscaling/
RDS MultiAZ deployment
https://aws.amazon.com/rds/details/multiaz/
Reference high availability architecture
http://media.amazonwebservices.com/architecturecenter/AWS_ac_ra_ftha_04.pdf
CLI
Autoscaling:
http://docs.aws.amazon.com/cli/latest/reference/autoscaling/index.html
Elastic load balancer:
http://docs.aws.amazon.com/cli/latest/reference/elb/index.html
Demo
Recover from hardware failure
Single EC2 instance with Elastic IP address. Create replacement EC2 instance and attach EBS volume from
old instance, associate Elastic IP to new EC2 instance.
Preparatory Steps:
● Launch EC2 instance in an AZ
● Allocate new Elastic IP address
● Associate Elastic IP address with EC2 instance
Failover Steps:
● Stop primary EC2 instance
● Detach it’s volume
● Terminate primary EC2 instance
● Launch new EC2 instance in same AZ
● Stop new EC2 instance (to replace EBS volume)
● Detach volume from new EC2 instance
● Attach volume of primary EC2 instance to new EC2 instance
● Start new EC2 instance
● Associate Elastic IP address with new EC2 instance
Recover from AZ failure
EC2, RDS and Elastic IP in a single AZ. Create standby EC2 instance in another AZ and keep it in stopped
state. Upon failure in primary AZ, create RDS instance in another availability zone using RDS snapshot.
Associate Elastic IP address to standby EC2 instance after starting the instance.
Preparatory Steps:
● Create AMI from primary EC2
● Create snapshot from primary RDS
● Launch standby EC2 instance using AMI in standby AZ
● Keep standby EC2 instance in stop state (ready for use if primary fails)
Steps on AZ failure:
● Start standby EC2 instance
● Launch RDS instance in standby AZ using primary RDS instance’s snapshot
● Dissociate Elastic IP from primary EC2 and associate to standby EC2
● Terminate EC2 and RDS in primary AZ
High availability in single AZ
Create two EC2 instances behind an ELB with single AZ RDS.
Steps
● Launch 2 EC2 instances using your AMI in a single AZ
● Launch RDS instance in same AZ
● Launch ELB and associate with 2 EC2 instances
MultiAZ EC2 and RDS
Create two EC2 instances behind an ELB, one instance each in two AZs, and with MultiAZ RDS.
Steps:
● Launch one EC2 instance each in two AZ
● Launch multiAZ RDS
● Create crossAZ ELB and associate with 2 EC2 instances
MultiAZ with AutoScaling Group
Create an autoscaling group with minimum 2 and maximum 8 EC2 instances behind an ELB. Instances
should be evenly deployed in two AZs. Create multiAZ RDS instance.
Steps
● Create VPC with 2 subnets in 2 AZs
● Launch multiAZ RDS in VPC, primary in one subnet and secondary replica in second subnet
● Launch crossAZ ELB
● Create multiAZ autoscaling group in the VPC with min 2 instance and max 8 instances. Autoscale
based on CPU utilization thresholds
● Associate ELB with Autoscaling group
Assignments
● Repeat above scenarios using your own AWS account.
● Do cost comparison between all scenarios listed above.
● Use Route 53 to create a multiregion high availability architecture. Hint: Use 2 Elastic load balancers,
running EC2 instances in multiple AZs within each Region.