Multi-region fail over with Amazon Route 53
Last lab for the ACA certificate, so hopefully its a good one! Today’s blog is about Route 53, so what does route 53 do? in the simplest form, It is used to have a infrastructure available over entire regions! So it is very similar too a load balance, but at one layer higher.
For this lab, we will be using a health checker to watch the status of the regions and if one goes down, switch it over to the other region.
Time to Complete: 3 Hours
Lab Cost: 10 Credits
Version: A5L5
Inspect the environment
First off, we should document the infrastructure of the system and what regions we are using. It is quite a simple structure as the point of this lab is cross region, not the structure itself.
Region One: US East ( N.Virginia)
Instances: Web-Application-1 (3.213.148.118)
Region One: US West(Oregon)
Instances: Web-Application-2 (54.187.216.59)
Configure a health check
Now to set up a health checker to watch Web-Application-1. We can make this from within Route 53 services. The health checker I have set up is called “check-1” and it is watching the IP Address 3.213.148.118, which is Web-Application-1.
Configure your domain
Now within the domain name we are using, I am creating a thing called a record set. Basically, a record set is a way a domain can flow traffic and how it does it. The first record I am setting is for Web-Application-1 and set it up to have a policy of being the Primary Fail over and connect it to the health checker, that was just created.
The next record set is for the Web-Application-2 and it follows the same routing policy, however it is set to Secondary, So that whenever the primary fails, the domain knows where to send traffic to and in this case, its 54.187.216.59.
Check the DNS
Now lets see what is the current EC2 instance the domain is sending traffic too. Currently the Health checker is coming back healthy.
Another way to check what instance the domain is using, is by running a record set test. This just goes and grabs the current IP address and information the domain is using and as we can see it is using Web-Application-1.
Test the fail over
A simple way to replicate a failed system is too, well… turn it off as it safely cuts off all communications to the instance.
Now the health checker will be receiving errors as its not able to communicate, thus telling the Domain to switch over to the secondary record set. So if everything went well, we should be seeing a new IP address on the record test
Why use Route 53?
Route 53 solves the issue of don’t put all your eggs in on basket, with your network. It is just good practice to have your infrastructure in multiple locations as a disaster recovery plan. However, it is something that should be really thought of and documented as its basically duplicating the whole infrastructure and that can be very costly. On top of that, with the use of Multiple AZ’s across a region (and each AZ having multiple servers), the likelihood of needing Route 53 as a disaster recovery plan is overkill i personally feel.
I personally would use Route 53 in other ways, like a DNS/Domain router to send users to the right resources throughout your infrastructure.