Hello everyone!

My friend and I have each bought an optiplex server. Our goal is to selfhost a web app (static html) with redundancy. If my server goes down, his takes over and vice versa. I’ve looked into Docker Swarm, but each server has to be totally independent (each runs its own apps, with a few shared ones).

I can’t find a solution that allows each server to take over and manage loadbalancing between the two. Ideally with traefik, because that’s what we’re currently using. To me the real issue is the DNS A record that point to only one IP :(

  • slowmotionrunner@lemmy.sdf.org
    link
    fedilink
    English
    arrow-up
    3
    ·
    6 days ago

    I think what you’re looking for is what is sometimes called a “dns load balancer”. Offerings like Azure Traffic Manager or AWS Route 53 do this. You can set up health checks that the service will use to determine if one of your locations is down and then automatically update the DNS record to point to the other one. You can also get clever and do things that allow the DNS to resolve the IP of whichever of your servers is physically closer so you get the best performance. I’m not sure what options there are for selfhosting a DNS service like this, however, these services are extremely affordable – pennies – and run on very reliable infrastructure, which is what you want.

  • corsicanguppy@lemmy.ca
    link
    fedilink
    English
    arrow-up
    1
    ·
    7 days ago

    It’s okay to still use a hyphen between ‘load’ and ‘balancing’. As a bonus, what you write would then be English, too.

    • Mateleo@lemmy.dbzer0.comOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 days ago

      The hyfen stalled in front of the exclamation mark ! Joking aside, thanks for the recommendation, I thought it was all one word.

  • cron@feddit.org
    link
    fedilink
    English
    arrow-up
    2
    ·
    7 days ago

    Your challenge is that you need a loadbalancer. By hosting the loadbalancer yourself (e.g. on a VPS), you could also host your websites directly there…

    My approach would be DNS-based. You can have multiple DNS A records, and the client picks one of them. With a little script you could remove one of the A Records of that server goes down. This way, you wouldn’t need a central hardware.

    • Mateleo@lemmy.dbzer0.comOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      2 days ago

      The VPS remains this single point of failure :(

      The DNS-based approach seems to be the best bet for my use case.

    • Jeena@piefed.jeena.net
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      7 days ago

      That’s an interesting idea, need to check if they offer some kind of a API for that.

      But then there is this other thing, what about dns cache?