1

I am essentially trying to build is a poor mans server failover solution.

The non-profit organization I am part of is planning to host several web applications. In order to save on hosting costs we have decided to have the site hosted in-house. As a holdover until we can raise funds for a proper server room we have setup two desktop servers with virtual machines running the applications.

In terms of performance, the machines and the FiOS Business connection they are hosted on more than meet our current needs and they are in a colder dry area so cooling hasn't been an issue. The biggest problem going forward is a lack of any Battery Backup. The applications themselves are not mission critical and have been designed to be fairly robust and restore cleanly in the event of a power failure. However, our organization's website is also hosted on this server and is important enough to have some sort of redundant backup.

What I would like to build is a system where in the event of a power failure a UPS would provide emergency power to the servers and networking equipment and notify the servers of the power event. The servers would then make API calls to Amazon Route 53 DNS Service and reroute traffic away from the servers experiencing power failure and to a Heroku or Pagoda Box instance. These instances would run a Lite version of our website using content which is periodically pushed to them.

We are running a Linux environment. So how would a consumer-level UPS trigger a custom script on a power failure which puts the failover chain into effect?

LawrenceC
  • 75,182
Dan
  • 11

1 Answers1

2

You can configure apcupsd to run a custom script whenever an APC-brand UPS detects a power failure or return of mains power (along with many other UPS-related events). Those scripts can then perform any other actions which you are able to automate.

APC has various offerings in different price ranges; if something like this is an important factor in your purchase, make sure to check compatibility before you purchase the UPS.

Of course, I'm sure there are other alternatives as well; this is just one possibility, and one that I have some personal experience with.

Also consider whether your ISP's network will be functional in the event of a large power outage. You may be able to provide emergency power to your own networking equipment, but that might not necessarily be sufficient -- if you don't have Internet connectivity, your attempts to make DNS changes will fairly obviously fail. Depending on your specific reliability needs, it may be worth considering some sort of "are you still online?" test running on a host external to your own network (which would also take care of the situation when e.g. someone cuts the cable either accidentally or intentionally) as a secondary fallback mechanism.

user
  • 30,336