Answer the question
In order to leave comments, you need to log in
How to make a failover web server?
Initial data: There is a site, there are two servers. One of them contains nginx, MySQL and site content (audio, photo).
Task: If one of the servers goes down, the site should still be available.
Question: How to do it and what is needed for this? How can I make the client access the site and be redirected to server B if server A is unavailable and vice versa?
Thanks in advance for your replies.
PS: OS on both servers is Debian 5.
Answer the question
In order to leave comments, you need to log in
Host on Amazon and redirect from Amazon to any of your live servers.
The third "most reliable" server with nginx and such settings.
you need:
Shared storage (FC/iSCSI) with a clustered FS - for example ocfs2.
There you store html / database and other stuff you need.
Two machines are combined Heartbeat, in your cases behind the eyes.
The storage can also be made a backup somewhere else using drbd+ocfs2 :)
In this variation, you will have one server idle.
If you need one-time work, then in Apache the balancing module or through nginx.
DB replication.
To increase availability, it is necessary to divide the servers into roles and duplicate them. Database server, storage server and a couple of front-end servers with nginx. Then we can talk about some kind of fault tolerance.
If DCs are different, then you can only taxi through DNS records, there are no other options. Moreover, if you just write 2 records, if one DC falls, half of the requests will go nowhere. You can set the records to have a shorter lifetime, then draw a script on each DC that checks the neighbor for survivability, and if he does not receive a clear response from him, he tries to update the DNS zone. Only what kind of fuses should be provided for from split-brain ... Thus, if one site falls, half of the clients have worked and will continue to work; the second half will experience temporary difficulties. Still better than nothing, I guess.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question