-2

I'd like to deploy a web application in a robust manner.

The application itself is written using Elixir, which runs on top of Erlang/OTP, meaning that the application can be deployed on different nodes which can internally manage failover/takeover when one of them goes down for some reason.

However, DNS is not built for this: Adding multiple A-records does not mean that clients will try one of the other servers when the one they try to connect to does not respond in time.

A lot of people then give as answer 'use a load balancer', which is nice, but then the load balancer itself becomes a single-point-of-failure.

Luckily, I was pointed to the Border Gateway Protocol, which (if I understood it correctly) allows multiple servers to listen to the same IP-address, and could therefore maybe function as an alternative. I have no idea (yet) how BGP works internally though, and also not if you need dedicated hardware if you want to use it or not.

So what I'd like to do is to:

  • During normal usage, traffic should be split between the two servers roughly equally.
  • When one of the servers goes down, the other should take over all the traffic.

It would be wonderful if the servers could be configured while they are in a somewhat distant geographical location (i.e. not in the same building) to make sure that e.g. local power failures do not shut off both servers at the same time. I do realize that both Erlang/OTP and BGP require some geographical proximity, because network latency needs to be low enough for these technologies to properly work.

So my questions:

  1. Is this possible? If so, how?
  2. Do you need dedicated hardware (like special routers) to make this work, or could this also work in a context where the two servers would be VPSes (Virtual Private Servers) of different providers (in geographical proximity)?
Qqwy
  • 149
  • 1
  • 1
  • 5
  • 2
    Buy two load-balancers, this isn't rocket-science – Chopper3 Sep 14 '17 at 14:40
  • @Chopper3 I come mostly from a software engineering background, so my DevOps experience is still quite limited, which is exactly why I am asking thid question. Please elaborate :) Can you put two load balancers in parallel? Or is there some other mechanism at play here? – Qqwy Sep 14 '17 at 14:55
  • 1
    Yes, yes you can, some places have hundreds in parallel. – Chopper3 Sep 14 '17 at 15:29

1 Answers1

1

Instead of BGP use combination of haproxy (load balancer) with keepalived VRRP solution (solves VIP - Virtual IP). There is simple howto:

dasunhegoda.com/how-to-setup-haproxy-with-keepalived/833/

or maybe even better example from RH documentation:

access.redhat.com/documentation/en-us/red_hat_ceph_storage/1.3/html/object_gateway_guide_for_red_hat_enterprise_linux/haproxy_keepalived_configuration

And don't forget to set kernel parameter:

net.ipv4.ip_nonlocal_bind=1

on haproxy nodes so both can bind the VIP.

For the haproxy you may google for some other solution which matches your needs more.

Jaroslav Kucera
  • 1,545
  • 11
  • 18