Answer the question
In order to leave comments, you need to log in
How to switch to a backup server?
Good afternoon!
The task is to ensure the continuous operation of several services.
There are two servers - primary and backup. They are hosted by different hosts.
If the main server is unavailable, clients should be directed to the backup server.
What are the options for solving this problem? It is necessary that the availability of services tend to 100%
Server on Linux.
Answer the question
In order to leave comments, you need to log in
1. DNS roundrobin
2. Client roundrobin - when the client itself sorts out IP-shniks. This is possible if the application has already been downloaded and can be run offline.
In DNS, in the A record, specify both IP addresses.
The browser will turn to the first person to respond.
But this is the easiest part.
You also need to constantly synchronize the database between servers - this will already be a gem.
Round robin DNS is used to distribute the load on different servers, but this has nothing to do with fault tolerance
For fault tolerance, they usually do this:
- Check the availability of the main server every minute with a script
- If it is not available, then specify the IP of the backup server in the A-record via the DNS provider API .
- If it was not available, but is now available, then specify its IP.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question