Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 in my web.config.

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.

share|improve this question

Your webservers probably can't access the Elastic IPs because of firewall rules associated with your security groups. You should be sending traffic over the internal IP addresses, anyway, or you'll be charged extra for data transfer.

Instead of Elastic IPs (which take a few minutes to transfer anyway), you could use a service like DNS Made Easy's dynamic IP addresses, set with very low TTLs, where the database hostname is changed from HostA's internal IP to HostB's internal IP on failover.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.