AWS Route53: DNS Failover Now with Elastic Load Balancer Support

    Hello friends! image

    Most recently, an astlock article on DNS faylover was published. The feature, of course, is cool and convenient, but those who hosted large projects with ELB in AWS did not feel the new at all. If the feylover does not work with ELB, then to me personally this function is absolutely useless.

    But then came the day when it became possible to use the benefits of Route53 with ELB. By setting up recording in Failover mode and connecting it to ELB, we thereby enable the ability to automatically monitor ELB. Switching the recording from Primary to Secondary will happen automatically in the following situations:image
    • ELB failure and unavailability
    • lack of healthy instances under ELB

    Route53 now makes it possible to automatically move in the event of a failure of the entire region.

    In this article I will tell you how I tested the new functionality.

    So, for the tests, I set up 2 ELBs and one instance under each of them. On one I installed Apache, and on the other nginx, to distinguish between them.

    Route54 was configured as follows:
    image

    As you can see, one entry is Primary, the other Secondary.

    In the normal state, the domain test.kozhokaru.com shows the Apache page, i.e. our live app.
    image

    The domain will prompt:
    $ host test.kozhokaru.com
    test.kozhokaru.com has address 23.21.77.253
    

    For the test, we go to the host and extinguish the Apache, thereby simulating the application crash. And we begin to look at what is happening on our web page: After
    image

    about 40 seconds, ELB understands that the instance under it is not healthy:
    image

    And after another 2 minutes we get a feylover page:
    image
    IP address has changed:
    $ host test.kozhokaru.com
    test.kozhokaru.com has address 107.21.245.152
    

    We return everything by running Apache on the first host. Depending on your ELB helcheck, the host will be healthy after a certain amount of time:
    image

    And after 1 minute 40 seconds, the domain returned to the main ELB.

    IP address has changed back:
    $ host test.kozhokaru.com
    test.kozhokaru.com has address 23.21.77.253
    

    conclusions


    An automatic domain faylover takes about two minutes , a return back is somewhere the same.

    Now we have in our hands a wonderful function that will undoubtedly help us in building highly accessible distributed systems .

    Only registered users can participate in the survey. Please come in.

    New functionality, impressions

    • 6.3% Already use, now even more convenient 3
    • 23.4% Now we will definitely use 11
    • 51% Interesting to look closer 24
    • 4.2% Not Interesting 2
    • 2.1% Tried, not happy with work 1
    • 12.7% Other (in comments) 6

    Also popular now: