By mattse
Hey guys,
I’m learning the ropes for high availability ops work. I have requirements that my HA setup also be capable of failing over to different data centers (or simply include more than one datacenter actively at once). Does this sound like a reasonable setup for what I’m trying to accomplish?
Create high availability setups in two different data centers. This likely includes 2 load balancers, web servers, and a database server in each physical location.
Use DNS round robin to distribute traffic to both data centers, using floating ips pointed at the primary load balancer of each data center. If one data center goes down entirely, remove that DNS record to route traffic to the other datacenter (albeit with a small delay due to TTLs).
Questions about the above:
In terms of database replication between data centers, I presume I’ll need to use master master replication? In this scenario, are there suggested best practices for connecting to the databases for replication since I cannot utilize private networking features?
I understand that DNS round robin is essentially random. Is there a better way to use DNS to smartly send traffic to the correct datacenter based on geographical location of the user?
Thanks!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
In terms of database replication between data centers, I presume I’ll need to use master master replication? In this scenario, are there suggested best practices for connecting to the databases for replication since I cannot utilize private networking features?
You can tunnel your MySQL replication over SSH which gets around the security issues with using the public network.
I understand that DNS round robin is essentially random. Is there a better way to use DNS to smartly send traffic to the correct datacenter based on geographical location of the user?
Nothing that I’ve personally encountered. When running your own DNS services it might be possible to do things much more actively at the DNS level.
For your failover configuration this guide might also be helpful. It outlines how to use heartbeat to do auto-failover of a floating IP. The same methods might be able to be used to determine if one of the data centers becomes un-reachable to your app.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.