0
0
AWScloud~10 mins

Multi-AZ deployment for high availability in AWS - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Multi-AZ deployment for high availability
Start Deployment
Select Primary AZ
Deploy Primary Instance
Select Secondary AZ
Deploy Secondary Instance
Configure Sync & Failover
Monitor Health
If Primary Fails?
YesFailover to Secondary
Continue Serving
Deployment Complete
This flow shows deploying resources in two separate availability zones to ensure service stays up if one zone fails.
Execution Sample
AWS
Create EC2 in AZ1
Create EC2 in AZ2
Configure Load Balancer
Set Health Checks
Enable Auto Failover
This sequence deploys two instances in different zones, sets up a load balancer, and configures failover for high availability.
Process Table
StepActionResource StateResult
1Select Primary AZPrimary AZ set to us-east-1aPrimary AZ chosen
2Deploy Primary InstanceEC2 instance running in us-east-1aPrimary instance active
3Select Secondary AZSecondary AZ set to us-east-1bSecondary AZ chosen
4Deploy Secondary InstanceEC2 instance running in us-east-1bSecondary instance active
5Configure Load BalancerLoad Balancer routing to both instancesTraffic balanced
6Set Health ChecksHealth checks monitoring both instancesMonitoring active
7Enable Auto FailoverFailover configured to secondary instanceFailover ready
8Primary Instance FailsPrimary instance downFailover triggers to secondary
9Secondary Instance Serves TrafficSecondary instance activeService continues without downtime
10Primary Instance RecoversPrimary instance back onlineFailback possible
11Deployment CompleteBoth instances running, failover activeHigh availability ensured
💡 Deployment completes with both instances active and failover configured for high availability.
Status Tracker
VariableStartAfter Step 2After Step 4After Step 7After Step 9Final
Primary AZunsetus-east-1aus-east-1aus-east-1aus-east-1aus-east-1a
Secondary AZunsetunsetus-east-1bus-east-1bus-east-1bus-east-1b
Primary Instancenot runningrunningrunningrunningdownrunning
Secondary Instancenot runningnot runningrunningrunningrunningrunning
Load Balancernot configurednot configurednot configuredconfiguredconfiguredconfigured
Failover Statusdisableddisableddisabledenabledenabledenabled
Key Moments - 3 Insights
Why do we deploy instances in different AZs instead of the same AZ?
Deploying in different AZs protects against zone failure. Execution table rows 2 and 4 show instances in separate AZs, ensuring if one AZ fails (row 8), the other can serve traffic (row 9).
What triggers the failover to the secondary instance?
Failover triggers when health checks detect the primary instance is down (row 8). This causes traffic to switch to the secondary instance (row 9), maintaining availability.
Can the system switch back to the primary instance after it recovers?
Yes, after the primary instance recovers (row 10), failback can occur to restore the primary as active, as shown in the deployment completion (row 11).
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, at which step is the secondary instance deployed?
AStep 4
BStep 2
CStep 6
DStep 8
💡 Hint
Check the 'Action' column for 'Deploy Secondary Instance' in the execution table.
According to the variable tracker, what is the state of the primary instance after step 9?
ARunning
BDown
CNot Running
DStarting
💡 Hint
Look at the 'Primary Instance' row under 'After Step 9' in the variable tracker.
If failover was not enabled at step 7, what would happen at step 8 when the primary instance fails?
APrimary instance would auto-recover immediately
BTraffic would continue to secondary instance
CService would experience downtime
DLoad balancer would shut down
💡 Hint
Refer to the 'Failover Status' variable in the tracker and the failover action in the execution table.
Concept Snapshot
Multi-AZ deployment means placing resources in two separate availability zones.
This protects your service if one zone fails.
Deploy primary and secondary instances in different AZs.
Use a load balancer to route traffic.
Set health checks and enable automatic failover.
This setup keeps your service running without downtime.
Full Transcript
Multi-AZ deployment for high availability involves deploying resources in two different availability zones to protect against zone failure. First, you select a primary AZ and deploy an instance there. Then, you select a secondary AZ and deploy a second instance. A load balancer is configured to route traffic to both instances, and health checks monitor their status. Failover is enabled so that if the primary instance fails, traffic automatically switches to the secondary instance, ensuring continuous service. When the primary recovers, failback can restore it as the active instance. This approach ensures your service remains available even if one AZ goes down.