Understand AWS Cross Region Failover in 10 Easy Steps
Understand AWS Cross Region Failover
in 10 easy steps
- Ishant Kumar
Each Amazon EC2 region is designed to be
completely isolated from the other Amazon EC2
regions. This achieves the greatest possible fault
tolerance and stability.
Amazon EC2 provides multiple regions so that you can launch Amazon EC2
instances in locations that meet your requirements. For example, you
might want to launch instances in Europe to be closer to your European
customers or to meet legal requirements. The following table lists the regions
that provide support for Amazon EC2.
Amazon EC2 is hosted in multiple locations world-wide.
These locations are composed of regions and Availability Zones.
Each region is a separate geographic area. Each region has multiple, isolated
locations known as Availability Zones.
Amazon EC2 provides you the ability to place resources, such as instances, and
data in multiple locations. Resources aren’t replicated across regions unless you
do so specifically.
Amazon operates state-of-the-art, highly-available data centers. Although rare,
failures can occur that affect the availability of instances that are in the same
If you host all your instances in a single location that is affected by such a
failure, none of your instances would be available.
All communications between regions is across the public Internet.
Source : http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-
In this Presentation, I’ll demonstrate the feature of AWS Route 53
which can be used for Cross Region Failover of application deployed in
For Example : One Application is deployed in N. Virginia and same in
N. California so when N. Virginia goes down we’ll be having access to
our application which is in N. California.
Create two ec2 instances in two different regions . In our case I am
provisioning one instance in N.Virginia and other one in N. California
### Instance in N.Virginia
Install httpd server on each EC2 server and create a index.html file.
# yum install httpd
# cd /var/www/html/
# vim index.html
Add Contents in index.html file in order to distinguish in between the
—index.html in N.Virginia
This Webpage is from N.Virginia Region
—index.html in N.California
This Webpage is from N.California
Start the httpd Server in both EC2 server.
#service httpd start
Go to Route 53 and create health check at port 80 for both the
instances as by default httpd server works on port 80. Here we are
monitoring the health (service running) on the instances.
wait till the status becomes healthy.
Now in Route53, create a recordset in a hosted zone.
In this article I have a domain registered with name ishantkumar.in in
Route53. I am going to create one recordset with name
Select the recordset and click on Go to Record Sets.
Enter the Recordset name. I created test.ishantkumar.in.
Enter the public IPs of both the instances (one in a line only).
Set the routing policy as failover.
Associate the health check type of one the instance which we created
in step 5.
In this Article, I am giving NVirginiaHealthCheck as primary.
Test the website. (test.ishantkumar.in) . It will show you the webpage
associated with Primary Health Check. In our case web page hosted in
Delete the N.Virginia’s instance and check your website.
Still we are able to see the website but this time we are getting web
page hosted in N.California Region. It shows even one region goes
down, website is still up and running in another region.
Looking Forward for your interest in DevOpsJourney.com
Email us: email@example.com