Hostwick.com/ElCheapoFailoverSystem  

Home   Products   Services   Contact   Articles   Links  
 

DIY El cheapo failover how-to

1. Get at least two el cheapo hosts. There are plenty to choose from.
The choice of backup host isn't so crucial because you won't be using it a lot,
unless you have a secret agenda for fully utilizing everything.

2. Get Dynamic DNS services.
Some el cheapo registrers like registerfly offers one FREE.
You can use other Free Dynamic DNS services, too.
If you don't mind paying a bit to get something better.

3. Decide which one of el cheapo host would be the primary.

4. Set up back up site as you want.
Often, it's easier to make the dynamic portion of your site "read-only"
on the back up site.
This can be done easily with slight permissions/script modification.

5. Set up regular monitoring cronjob on all hosts, monitoring all other hosts,
and when they detect prolonged downtime, send DynamicDNS request.

That's all.

Not very complicated as long as you can accept failover delay of 15 minutes or so.
Monitoring and automatic switching is the key.
Technically, it's pretty simple.

You can simply use wget or netcat, cUrl type of thing to issue HTTP request
to a small (shell script) CGI, more or less like this, placed on each site.
(Password protect it, at least)
#!/bin/sh
echo
exec 2>&1
time
hostname
uptime

It can be written like this, if you prefer.
#!/bin/sh
echo;exec 2>&1;time;hostname;uptime

Then, parse and analyze the result (or the lack of it) and decide (automatically) if it's worth bothering switching Dynamic DNS.
(It can be done with simple small shell script, too. Or you can use any one of reliable languages you like.)

If you want, you can monitor the name resolution, initial connection, sending the request, and the result, separately to make better decision making logic.

If you use registerfly's FREE DYnamicDNS, switching can be done by making a simple HTTP request with a password, domain name, and the IP.
(You just hope that the security situation of the host is tight enough to prevent fellow users or crackers from getting these info ....)

It's safer if you use your home machine to issue DNS switching HTTP request.
Monitoring can be done from home, too.
But it's better to monitor from multiple locations to avoid unecessary switch when only small network portion is down.

You can put more effort to make Dynamic portion to work seemlessly
on the backup site, too.
You can add some codes to all writing function so that the data is sent to the backup site (or journaled and sent periodically).
While it may not offer total redundancy, the possible data loss can be pretty small.

But it's better to use a host with lots of redundancy (net connection, firewall/switch, webserver/cgi, DB, FTP, mail, logging, and NFS, etc.) already builtin, IMO.

It will cost more and it might be slower, but it saves lots of time and effort.
For the el cheapo solution, I think simple static (or read-only) failover site is enough.
You can bring up the dynamic portion when you feel like so, later.

Some el cheapo hosts (ServageNet, NetFirms, HostingZoom for example) have already
certain degree of redundancy built-in (webserver/cgi/php portion),
and they are surely more reliable than single server setup or cluster without builtin redundancy.

Conclusion:

You can construct el cheapo DIY failover system under $15/month.
Depending on your requirement (and rebates offered by el cheapo hosts like DreamHost), the cost can be even less.
(Other el cheapo candidates: zone.net Free hosting? http://www.netfree-hosting.com/ )

Actually, you can do that using FREE web hosting services and FREE BLOG's.
Only thing you need is the domain name, which you can buy less than $2 per year, sometime, somewhere, and then to be transfered to registerfly or somewhere with more services (always with discount and promo).

Related Links

ClusteringLinks
 
Home   Products   Services   Contact   Articles   Links  
Hostwick.com --- Generated on 2006-10-25_09:31:35