Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


A question regarding fallback
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

A question regarding fallback

So I had an idea in mind not sure who to ask but if say I have 2 servers, one that is used to actually run the main services but server 2 which acts as a fallback/backup in case the main one goes down.

So how exactly do I make it a automated fallback type of thing? Say for example, I have an IP of 44.243.239.12 and Server 2 has an IP of, 93.24.56.7.8, is it possible if the main server goes down for x amount of time to use IP of Server 1 for Server 2? Or something?

Sounds a little stupid but I'm trying to think of a way to ensure the fallback is as smooth as possible without the client having to notice like an IP change for example which is something I'd want to avoid.

Comments

  • If you have a floating IP address, you can assign it to point to your main server. If your floating IP provider has an API (i.e. Digital Ocean), you can set up a simple script on a 3rd server that continuously ping your floating IP until it is unreachable for X seconds, then send an API request to redirect the floating IP to your fallback server.

  • IonSwitch_StanIonSwitch_Stan Member, Host Rep

    93.24.56.7.8

    IPv5?

    There are a number of ways to achieve this. 44.243.239.12 is AWS, if both of your instances are in AWS, you can use ALB/ELB to load balance them. If they aren't on the same provider, you can look at using DNS with healthchecks (route53 does it, as do others).

    The most important aspect will be to actually test it!

    Thanked by 1yoursunny
  • @IonSwitch_Stan said:

    93.24.56.7.8

    IPv5?

    There are a number of ways to achieve this. 44.243.239.12 is AWS, if both of your instances are in AWS, you can use ALB/ELB to load balance them. If they aren't on the same provider, you can look at using DNS with healthchecks (route53 does it, as do others).

    The most important aspect will be to actually test it!

    They're just random IPs I typed out for this example haha.

  • yoursunnyyoursunny Member, IPv6 Advocate

    @sgno1 said:
    They're just random IPs I typed out for this example haha.

    You should have used an RFC5737 address.

  • Are you actually planning on load balancing? Or must all traffic go to only one server at any one time?

  • jarjar Patron Provider, Top Host, Veteran

    CloudFlare API is a really great way to do this at no cost. If you enable their proxy (the orange cloud), the A record will be their IP. This means changing your back-end IP address results in immediate change, no DNS "propagation" (misleading term but let's go with it) required.

    This is an example of a method for implementing it:
    https://www.hitsteps.com/blog/cloudflare-automatic-ip-failover/

  • @jar said:
    CloudFlare API is a really great way to do this at no cost. If you enable their proxy (the orange cloud), the A record will be their IP. This means changing your back-end IP address results in immediate change, no DNS "propagation" (misleading term but let's go with it) required.

    This is an example of a method for implementing it:
    https://www.hitsteps.com/blog/cloudflare-automatic-ip-failover/

    Really interesting idea, but doesn't it do a DNS failover? Not sure if Cloudflare supplies it's own IP that can be used as the front face for the server but that's what I want in a way. An IP that will act as the main IP, if Server 1 goes down, uses that IP as the main IP for Server 2. Since IPs will be handed out not a domain.

  • Cloudflare has its own IPs.

    So you will go DNS > Cloudflare IP > Your IP. So no DNS update is required, you just have to let cloudflare know your new / failover IP and you're up and running again.

    I wonder what you are running though since you are talking about a cold standby which is imho a waste of hardware / resources. Why not a hot standby and load balance between two servers?

  • @marvel said:
    Cloudflare has its own IPs.

    So you will go DNS > Cloudflare IP > Your IP. So no DNS update is required, you just have to let cloudflare know your new / failover IP and you're up and running again.

    I wonder what you are running though since you are talking about a cold standby which is imho a waste of hardware / resources. Why not a hot standby and load balance between two servers?

    >

    Quite new to this fallover stuff. If I could learn both methods it would be a good way to see the pros/cons for both methods and I'll be able to learn more.

    Regarding the Cloudflare Method, does Cloudflare supply a Unique IP to each client? If so will I be able to forward traffic like on specific ports such as UDP/TCP (/or ports 21, 80 etc).

  • I'm curious with this kind of setups for monolithic apps, especially write intensive apps. Is your DB replicated across all servers? If not, what's your setup?

  • @sanmax88 said:
    I'm curious with this kind of setups for monolithic apps, especially write intensive apps. Is your DB replicated across all servers? If not, what's your setup?

    Is that a question to me?

  • @sgno1 said:
    So I had an idea in mind not sure who to ask but if say I have 2 servers, one that is used to actually run the main services but server 2 which acts as a fallback/backup in case the main one goes down.

    So how exactly do I make it a automated fallback type of thing? Say for example, I have an IP of 44.243.239.12 and Server 2 has an IP of, 93.24.56.7.8, is it possible if the main server goes down for x amount of time to use IP of Server 1 for Server 2? Or something?

    Sounds a little stupid but I'm trying to think of a way to ensure the fallback is as smooth as possible without the client having to notice like an IP change for example which is something I'd want to avoid.

    You can use Dynu's DNS failover which will change the IP for the host name as soon as it senses the IP is down. It will also revert the IP back to original one once the IP is accessible.

Sign In or Register to comment.