How do you automate failover on EC2?

Well, I don’t mean to just state the obvious, but the general idea is to push this complexity into the services managed by Amazon. So on the frontend, you would use Amazon Elastic Load Balancing (ELB) to provide highly available load balancing. On the rear end, you use Amazon Relational Database Service (hosted MySQL), SimpleDB, … Read more

Using SignalR with Redis messagebus failover using BookSleeve’s ConnectionUtils.Connect()

The SignalR team has now implemented support for a custom connection factory with StackExchange.Redis, the successor to BookSleeve, which supports redundant Redis connections via ConnectionMultiplexer. The initial problem encountered was that in spite of creating my own extension methods in BookSleeve to accept a collection of servers, fail-over was not possible. Now, with the evolution … Read more

When my A web server gets unplugged, how do I automatically redirect all the users to my B web server in another city, and vice versa?

Sounds like you may be looking for a Global Server Load Balancing (GSLB) solution. GSLB usually uses “smart” DNS to direct users to different servers based on a number of parameters (i.e. server unavailable, high load, ip geolocation, etc). As an example, say you have two web servers, one out west (10.10.10.1/24) and one east … Read more

Multi-site high availability

To do this properly, you need to have: Two seperate instances in two datacenters (as you’ve already determined) Synchronisation between the two datacenters (as you’ve already determined) A way of re-directing clients from one to the other in the event of a failure There are two common ways of doing this. One simple, one… not. … Read more

What happens when a load balancer fails?

Typically load balancers are clustered together into a high-availability pair. If one load balancer fails, the secondary picks up the failure and becomes active. They have a heartbeat link between them that monitors status. If all load balancers fail (or are accidentally misconfigured), servers down-stream are knocked offline until the problem is resolved, or you … Read more

DNS Round Robin: Do browsers stick to one IP as long as it is online?

Each browser has it’s own method of handling round-robin DNS, I’ve spent some time today researching this problem and will continue to update my answer as I find proof of implementation which will limit my answers to browsers that expose their behavior. Google Chrome Google Chrome (v58 used) will request all host entries for an … Read more

nginx failover without load balancing

What you want is an active+passive setup. Here’s an example nginx conf snippet to get you going: upstream backend { server 1.2.3.4:80 fail_timeout=5s max_fails=3; server 4.5.6.7:80 backup; } server { listen 80; server_name whatevs.com; location / { proxy_pass http://backend; } } So, ‘normally’, all requests will go to host 1.2.3.4. If we get three failures … Read more