HA and Elasticity Flashcards
EC2 virtualization types
hardware virtual machine HVM (new and better way)
para virtualization PV
Change Instance Type
- stop instance
- change instance type
- only works for EBS backed root volume
- cannot be used for machines which use instance store to store root volume
- new instance type should be compatible with the existing instance virtualization type i.e. HVM or PV
Setting up ELB and Autoscaling group
- Create hosted zone in Route 53, copy NS records provided by AWS into godaddy
- Create new certificate from AWS to be applied to ELB
- Go to ELB setup and click on classic ELB, select AZ and all other parameters. Add the registered cert since we have to use port 443. Don’t set any EC2 instances as yet
- Create new DNS record in Route 53 with ELB url and CNAME
- Goto autoscaling group - 2 steps - launch configuration and setup auto scaling group
Launch Configuration
1. Select AMI, name, Role, etc
Autoscaling Group
- select VPC
- select group size
- select subnet
- select ELB
- select scaling policies - CPU/Memory etc
- Setup notification SNS
Classic ELB v/s Application ELB
Classic ELB
- makes routing decisions at application or transport layer (layer 4)
- it can only inspect only IP and port
application ELB
- makes decisions at application level (layer 7)
- it can inspect not only port and IP but also application level content,
- it can have more complex rules i.e. looking at url parameters and making a routing decision
- It has path based routing
Scaling ELB
- auto scaling based on cloudwatch metrics or on demand
- scaling based on schedule
scaling policies
- step based - don’t have to wait for cool down period, you can go on responding to scaling needs when triggered
- simple - need to wait for cool down period once scaling starts to restart again
Actual metric is aggregate of all the instances in the autoscaling group.
Using spot instances for autoscaling
- need to setup launch configuration to use sport instances. Need to add max bid price
- . Create new autoscaling group with this new launch configuration
Note: cannot use t2.micro as spot instance
Lifecycle Hooks
Allows us to execute scripts on the new instances before they are provisioned after a scaling event. Also can provides a handle before scaling down.
Provides ability to execute cleanup logic etc.
Architecting of new Application
TODO