2

I have 2 EIPs allocated for a cloud app, which are used in round robin DNS. I'd like to have some sort of high availability mode for our 2 gateways (proxies) which are associated with those EIPs, so I was thinking to have a gateway in each of the 3 AWS availability zones and stick 2 NLBs in front of them: EIP 1 is attached to NLB 1, which round robins across Gateway A and Gateway C and EIP 2 is attached to NLB 2, which round robins across Gateway B and Gateway C.

According to the docs (see NLB section):

Network Load Balancer automatically provides a static IP per Availability Zone to the load balancer and also enables assigning an Elastic IP to the load balancer per Availability Zone.

From this, I gather that an NLB can only associate an EIP with an availability zone, which makes me think that I can't use it for my setup. Is this correct?

What alternatives would I have, assuming that I want the 3 Gateway instances (one being redundant) and I'd like each of them to be in a separate availability zone?

Mihai Todor
  • 222
  • 1
  • 3
  • 13

1 Answers1

1

It turns out that NLBs can be used in this scenario because they now support Cross-Zone Load Balancing.

NLBs offer builtin High Availability and they are designed to not go down when a whole Availability Zone is impacted, so I decided it's sufficient to use a single instance. Since an EIP can only be associated with a single Availability Zone, I ended up with the following setup:

  • 2 public EIPs allocated, which are used in round robin DNS
  • one NLB set up to associate EIP_1 with AZ_a and EIP2 with AZ_b
  • 4 gateway instances, 2 being deployed in AZ_a and 2 in AZ_b, and associated with the NLB's target group

This setup ensures that each instance takes 25% of the traffic in normal situations and, by enabling cross-zone load balancing on the NLB, we can tolerate one AZ going down, since the NLB will just forward all the traffic to the remaining two gateways in the other healthy AZ. Note that regional data transfer charges may apply when cross-zone load balancing is enabled. See the documentation for details.

Mihai Todor
  • 222
  • 1
  • 3
  • 13