Many system administrators sooner or later have the task of "making a mirror of the site."
Practice shows that it is more logical to place a mirroring server in another data center. This will relieve headaches in an accident in the main data center. I think there are no comments here.
But how to organize the rapid switching of the site to a mirror in another data center?
We dismiss the option with BPG right away - it is too expensive, not everyone can afford to buy or rent expensive equipment, and there is an opportunity to come to an agreement with not every DC.
')
DNS servers come to the rescue with the ability to set a small TTL value (roughly speaking, the zone lifetime, after which other dns servers begin to request updated data from the NS where the domain data is located, and not from its cache). This approach increases the load on all DNS servers, but allows you to change the records in our zone on the fly. Whether this is bad or good is up to you.
Of course, you can use your servers by placing them in several data centers. But I preferred to shift the responsibility to a more reliable service -
DynDNS.org .
Advantages of this approach:
- the ability to install TTL from 10 seconds (I recommend to put at least 120)
- relatively low cost of DNS hosting (about $ 30 per year)
- Reliability (their site claims "a single failure
gap since 2001")
- the ability to change the zone using a samopis http-client, sending GET-requests (you can imagine what opportunities for automation open up)
Minuses:
- there is no possibility to steer the DNS server, creating complex configurations
- there are no slave servers in Russia. If the “foreign Internet” fails, your server will not be accessible from Russia
In general, everything.
I hope someone will benefit from my experience. I will be glad to answer questions and comments.
The purpose of this note is not to advertise the above service, but to point out one of the simplest and most reliable ways to organize mirroring without a single point of failure. The main message: "use a DNS server with a small TTL to quickly switch ip-addresses for the domain." You can use your servers - this is not the point.PS: My first note on Habré. :)