Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EC2 database server failover strategy

I am planning to deploy my web app to EC2. I have several webserver instances. I have 1 primary database instance. I have 1 failover database instance. I need a strategy to redirect the webservers to the failover database instance IP when the primary database instance fails.

I was hoping I could use an Elastic IP in my connection strings. But, the webservers are not able to access/ping the Elastic IP. I have several brute force ideas to solve the problem. However, I am trying to find the most elegant solution possible.

I am using all .Net and SQL Server. My connection strings are encrypted.

Does anybody have a strategy for failing over a database instance in EC2 using some form of automation or DNS configuration?

Please let me know.

like image 778
Dave Avatar asked Dec 19 '09 13:12

Dave


People also ask

What are the 3 different methods that you connect to a EC2 instance?

You can connect to an instance using the EC2 Instance Connect CLI by providing only the instance ID, while the Instance Connect CLI performs the following three actions in one call: it generates a one-time-use SSH public key, pushes the key to the instance where it remains for 60 seconds, and connects the user to the ...

How long will a failover of an RDS database typically complete?

Depending on your database activity at the time of the time of the outage, failover usually lasts between 60-120 seconds.

How does RDS failover work?

RDS Multi-AZ Failover ProcessRDS automatically switches to a standby replica in another AZ, if enabled for Multi-AZ. The time taken for the failover to complete depends on the database activity and other conditions at the time the primary DB instance became unavailable. Failover times are typically 60-120 secs.

How does failover work AWS?

On failover, the application servers continue connecting to standby database node without any intervention, making the failover seamless. In our example, we have a PHP-based web application running on two webservers (web_host1 and web_host2) behind a load balancer across two Availability Zones (AZ1 and AZ2).


1 Answers

http://alestic.com/2009/06/ec2-elastic-ip-internal

tells you how to use the Elastic IP public DNS.

like image 119
Dave Avatar answered Sep 16 '22 15:09

Dave