ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    how do you deal with SPOF with HAproxy

    Scheduled Pinned Locked Moved IT Discussion
    spoifhaproxyha
    15 Posts 10 Posters 1.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • scottalanmillerS
      scottalanmiller @Emad R
      last edited by

      @Emad-R said in how do you deal with SPOF with HAproxy:

      I wonder if this ever came across where you use HAproxy but wish to made it redundant and can sustain it going down.

      I think that's the main use case of it.

      1 Reply Last reply Reply Quote 2
      • scottalanmillerS
        scottalanmiller @Emad R
        last edited by

        @Emad-R said in how do you deal with SPOF with HAproxy:

        @travisdh1

        what about multiple A/AAAA records for multiple HAproxy ?

        That handles round robin, not failover. You need real HA. This is how HA-Proxy is meant to be used...

        https://www.digitalocean.com/community/tutorials/how-to-create-a-high-availability-haproxy-setup-with-corosync-pacemaker-and-floating-ips-on-ubuntu-14-04

        1 Reply Last reply Reply Quote 2
        • F
          flaxking
          last edited by

          DNS round robin for failover kind of works, but it's not the greatest solution. We use it for our nginx proxies.
          It relies on the application to move on to the second IP address if the first one times out.
          But I think the client DNS cache just stores 1 IP address, so you need a low TTL, because if one proxy goes down, clients that have that IP cached will lose access until they do a new DNS lookup.

          1 Reply Last reply Reply Quote 2
          • 1
            1337
            last edited by

            I've looked into it and the way I understand it is that it depends on your infrastructure.

            If you have haproxy load balancers in active/passive failover and they are together in the same LAN, you can use a virtual (floating) ip address. Search for haproxy heartbeat.

            1 Reply Last reply Reply Quote 1
            • matteo nunziatiM
              matteo nunziati
              last edited by

              Floating ip. But corosync is really an overkill. Vultr has a nice guide on floating ips.

              1 Reply Last reply Reply Quote 1
              • stacksofplatesS
                stacksofplates
                last edited by stacksofplates

                Keepalived is most likely what you're looking for. You assign a VIP to your interface and it keeps a heartbeat between the systems. The VIP (floating IP) will move between systems if there is an issue.

                Once that's set up, use Serf to update your HAProxy configs or Consul for automatic service discovery which HAProxy can read.

                If you're using a cloud provider, I'd just use one of their provided load balancers.

                matteo nunziatiM 1 Reply Last reply Reply Quote 4
                • ObsolesceO
                  Obsolesce @Emad R
                  last edited by

                  @Emad-R said in how do you deal with SPOF with HAproxy:

                  Hi,

                  I wonder if this ever came across where you use HAproxy but wish to made it redundant and can sustain it going down. I know it rarely ever go down but what do you do if you want to make it redundant.

                  Use something like Azure Traffic Manager.

                  That is designed to do exactly what you seem to be looking for.

                  1 Reply Last reply Reply Quote 0
                  • matteo nunziatiM
                    matteo nunziati @stacksofplates
                    last edited by

                    @stacksofplates said in how do you deal with SPOF with HAproxy:

                    Keepalived is most likely what you're looking for. You assign a VIP to your interface and it keeps a heartbeat between the systems. The VIP (floating IP) will move between systems if there is an issue.

                    Once that's set up, use Serf to update your HAProxy configs or Consul for automatic service discovery which HAProxy can read.

                    If you're using a cloud provider, I'd just use one of their provided load balancers.

                    +1 for serf but I can not find any doc about serf as a distributed config (as consul).
                    I know about serf as a discovery/alive tool only...

                    stacksofplatesS 1 Reply Last reply Reply Quote 0
                    • stacksofplatesS
                      stacksofplates @matteo nunziati
                      last edited by

                      @matteo-nunziati said in how do you deal with SPOF with HAproxy:

                      @stacksofplates said in how do you deal with SPOF with HAproxy:

                      Keepalived is most likely what you're looking for. You assign a VIP to your interface and it keeps a heartbeat between the systems. The VIP (floating IP) will move between systems if there is an issue.

                      Once that's set up, use Serf to update your HAProxy configs or Consul for automatic service discovery which HAProxy can read.

                      If you're using a cloud provider, I'd just use one of their provided load balancers.

                      +1 for serf but I can not find any doc about serf as a distributed config (as consul).
                      I know about serf as a discovery/alive tool only...

                      When systems send their messages to the cluster they can run a script depending on the message. Their example repository has simple Bash scripts to update an HAProxy config.

                      https://github.com/hashicorp/serf/blob/master/demo/web-load-balancer/README.md

                      It's very very simple, but sometimes that's easier than setting up a full Consul cluster.

                      1 Reply Last reply Reply Quote 1
                      • C
                        castleinfo
                        last edited by

                        I know this is an old post but thought I'd reply anyway:
                        Yes for simple configs DNS/GSLB in front, or something like Amazon ELB with PROXY PROTOCOL support for IP transparency.

                        But for anything complex like persistence with stick tables etc. then you need a pair of HAProxy nodes with a floating IP address:

                        You can use Keepalive which has already been mentioned (which lots of people like) and its very mature.
                        However we currently use Heartbeat from linux-ha.org - which is ancient and therefore pretty solid.

                        But anoyingly it's designed more for two servers with one sharred storage and STONITH (Shoot The Other Node in the Head).
                        Rather than load balancers where going active/active is not a problem.

                        AndyZaks PulseHA project (pulseha.com) is lightweight, fast and specifically design for load balancers.
                        He started the project because Heartbeat and Keepalived can be a right pain when they split brain (loose the heartbeat).

                        We're currently helping him add the finishing touches to it for our next gen version of Loadbalancer.org appliance.

                        1 Reply Last reply Reply Quote 1
                        • dbeatoD
                          dbeato
                          last edited by

                          We use DNS health checks for this, Route53 and CLoudFlare have this but it comes at a n additional cost.

                          1 Reply Last reply Reply Quote 0
                          • 1 / 1
                          • First post
                            Last post