2

I have 2 Nginx Load balancers, running on AWS, each with an elastic IP address. I want to implement fail-over on them.

Can I use Route53 to setup health check, so whenever one server goes down, then the traffic is routed to another server, based on IP? If this isn't possible then can I use CNAME or domain name to point to other IP in case one goes down?

Tim
  • 31,888
  • 7
  • 52
  • 78
Farhan
  • 4,269
  • 11
  • 49
  • 80

1 Answers1

1

Yes Route53 supports Health Checks where it can periodically make a HTTP request to each of your IPs and if any one fails to respond correctly it will be automatically removed from the DNS response until it recovers. See here for more details: https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover.html

Hope that helps :)

MLu
  • 24,849
  • 5
  • 59
  • 86
  • Route53 can also do simple load balancing, latency or geographic based load balancing, or a few or things which may be useful to you. The routing should be done using alias records directly to resources, rather than using IPs. – Tim Sep 30 '18 at 20:43
  • Actually this type of switchover will give a lot of delay during failover. i tried it and the failover happens after about 2-3 minutes, which is HUGE. i cannot face such downtime, in production environment – Farhan Sep 30 '18 at 21:51
  • @Farhan ideally you'd have the traffic routed to **both endpoints** under normal circumstances, i.e. the clients will get *both IP1 and IP2* and pick one. If IP1 dies then 1. the clients will still resort to the other IP in the response, and 2. R53 will notice and stop sending IP1 in the responses. You should see very little downtime. Unless you're routing *everything* to IP1 by default and once that fails wait for the DNS to start sending IP2. But that's not a recommended setup. – MLu Sep 30 '18 at 21:55
  • You should ask a new more open / general question about the best way to do load balancing, rather than this very specific question. In general you should use managed services where possible, AWS ALB for example. – Tim Sep 30 '18 at 23:44
  • Cannot use ALB, as i need hundreds of Unique SSL certificates on Load balancer as SSL termination. ALB only supports 25 per ALB – Farhan Oct 01 '18 at 10:54