Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
If your load balancer went down in the environment described in this article, your site would become unavailable.
The easiest way to avoid having the load balancer be a single point of failure is to set up active/passive HAProxy pair. This would require two HAProxy servers and a virtual IP that can float between the two servers. The active HAProxy server would handle all of the requests unless it went down, at which point the passive HAProxy server would take over the requests.
@idanielinc: In this set up, the load balancer is still a single point of failure. This is still a fairly basic set up to illustrate the concepts. For true “high availability” you’d need to have multiple HAProxy servers with some sort of failover using VRRP (http://en.wikipedia.org/wiki/Virtual_Router_Redundancy_Protocol). Keepalived (http://www.keepalived.org/) is often used for this.
Take a look at route53 or another dns service that supports health checks. You can run two load balancers and if there is a problem it should automatically switch your sites IP to the redundant LB. If you set a low TTL on your sites A record it shouldn’t be too bad. I haven’t tried this ‘yet’ but it may be a replacement for a floating virtual ip?
I want to send requests to different backends, depending on the status of the response. I mean, one backend will be the primary one, receiving all requests if it is available, and the second backend will only be used when the first one is not available. If, in the first backend, the server is unavailable (response status code = 503), I would like to send the request to the second backend, but I have a problem when creating an ACL with the check of the status response to decide which backend to use.
The frontend part in my configuration file looks like the following (assuming my two groups of backends are named ‘backend_servers’, the primary one, and ‘backend_servers2’, the secondary one):
acl statusResponse status eq 503 use_backend backend_servers2 if statusResponse default_backend backend_servers
The HAProxy is returning the following error:
acl ‘statusResponse’ will never match because it only involves keywords that are incompatible with ‘frontend use-backend rule’
How can I get the desired balancing? (i.e. having a primary backend and a secondary backend, only used when the primary is not available).
@angelica1988: When you get 503 from the backend, this means that the request has already been received by HAProxy and routed to the backend and at this point the load balancing decision has been made. I think what you need is a http health check for the backend servers that will disable them if they respond with 503. The deeper the health check the better.
About that response:
“If your load balancer went down in the environment described in this article, your site would become unavailable. The easiest way to avoid having the load balancer be a single point of failure is to set up active/passive HAProxy pair. This would require two HAProxy servers and a virtual IP that can float between the two servers. The active HAProxy server would handle all of the requests unless it went down, at which point the passive HAProxy server would take over the requests.”
Can I have a virtual IP that can float between the two servers with Digital Ocean? How can I configure this?
I have two droplets with active/passive HAProxy pair + keepalived, but I don’t know how to set up the Virtual IP.
Thanks!
Nice tutorial mitch, if i may ask what is the image tool you used to created the gif image for “NYC3 high availability setup”?
Hi, In the article’s “Backend” section :
"backend blog-backend balance roundrobin mode http server blog1 blog1.yourdomain.com:80 check server blog1 blog1.yourdomain.com:80 check "
Kindly update the blog-backend second server to server blog2 blog2.yourdomain.com:80 check
Thanks, Reema
How can we achieve Load Balancing without using DNS server? And can we use one of the real server as a Load Balancer?