High availability
The goal is to create a near zero downtime situation during maintenance. The logistics are a pain from a database standpoint since the 2 different linodes need to be in sync as close as possible.
The ultimate capability would be to share disk space between 2 different linodes for the database but this would just be a plus. That way there would be no need to keep a database synced between 2 boxes.
I don't know how much of this is possible to make "HA" viable to use on a linode. At a minimum it would require a single ip address to be able to work on 2 different linodes.
6 Replies
I use dsnmadeasy.com so my DNS doesnt depend on my machines. With DME you can control the TTL (unlike say zoneedit) so you can switch IP quickly. Also DME has some kind of monitoring facility which will detect failure and automatically switch the ip. They also support round robin IPs. the price is good.
For database I use mysql with replication. Although my web server only runs in one place at a time, other services run on both machines and update the db. So my app on the slave does local queries but sends updates to the master (which then get replicated back). If the primary fails, I manually switch the IP in dnsmadeeasy and bring up the webserver on the backup.
Maintenance is infrequent so its done manually; otherwise I would probably use rsync.
The IP address is on the primary linode. The second monitors it, and as soon as it is no longer available it brings up an interface for the IP address (IP address take-over) and does some ARP cache cleverness. When the original primary comes back up it takes the role of the secondary.
The tricky part of doing this on a Linode is they recommend having two network connections between the nodes (say ethernet and a serial line) so that a connection failure doesn't make the secondary incorrectly asume the primary has gone.
A DNS solution is much easier to implement, but you have to wait for the DNS to propagate, so you're not going to get a very fast response.
I've never done IP address take-over, so please let us know how you get on.
When you mention 'ARP cache', that says 'two machines on the same LAN'.
In other words, this won't protect you from a silly twit at TP tripping over things or touching power setups inappropriately.
(Point being that this only protects you against an individual node outage, but not against entire data centre outages.)
That type of high availability does work; I've done it on big iron at work (as well as geographic failovers on top of local failovers), though there's a lot of details involved and indeed requires multiple types of physical connections for the reasons you described.
You can probably get away with doing it over IP, but it may not be as reliable. The most dangerous situation is a 'split brain' scenario where both sides are up and working, but thinks the other has failed, and both proceeds to act as a master. Cleaning up after that kind of situation can be non-trivial, unless the setup was designed to make this an impossibility.
For most people with a setup like at Linode, just designing their applications to feed two hosts at same time (one in each data centre) and manually designating one as a master, at any given time, would probably work out to be the most cost effective and reasonable approach.
As always, the devil's in the details.
I'm not sure the original poster's idea for a single IP on two different Linodes is a good idea… because this means that if the data centre goes down, one now has no availability at all. And certain data centres are infamous for outages. cough
@tronic:
In other words, this won't protect you from a silly twit at TP tripping over things or touching power setups inappropriately. ;)
I think we should note that this is completely impossible and never happens. :)
@NecroBones:
@tronic:In other words, this won't protect you from a silly twit at TP tripping over things or touching power setups inappropriately.
;) I think we should note that this is completely impossible and never happens.
:)
Please remove tongue from cheek before you choke on it:-)
@sweh:
Please remove tongue from cheek before you choke on it
:-)
If his tongue is in his cheek, he won't choke on it.
He'll bite it off when the power to his Linode goes down.