0

Sorry for a dumb question but I`m a green hand yet.

I have two Linux server: one of it is running Apache with MySQL to serve my web-platform (master server) another one is supposed to be a sort of replication to provide a fail over (slave server). This machines maintained by different hosters and DNS-servers.

All information that I`ve found on the Internet to implement this, is based on a common virtual IP or solutions for the severs which are situated at the same LAN (Clusters like Heartbeat,RedHat; DRBD, protocol CARP, so on) which is not suitable for me.

Is there any solution which will monitor Server status and in case of non-response switch work from master to slave and after its repair switch it back? I guess it should work via DNS failover. Or only traffic balance can help me?

Ver
  • 33
  • 1
  • 7

3 Answers3

1

Consider Amazon AWS Route 53 DNS which has such failover capabilities. Also works for servers hosted externally to Amazon AWS:

http://gc-taylor.com/blog/2013/04/02/amazon-route53-failover

JayMcTee
  • 3,923
  • 1
  • 13
  • 22
0

Well, we usually try these solutions when we have control over the infrastructure hosting it. Since you're hiring a hosting company, it's their obligation to keep it running in a specified SLA (Service Level Agreement). But if you're really into it, I suggest you at least hire a single company and either a SaaS or a IaaS solution to accomplish that.

Stefano Martins
  • 1,221
  • 8
  • 10
0

Yes, there are load balancing services out there that will do what you ask. Because we own our own hardware, we actually have a hardware solution, using Barracuda load balancers. They monitor a page on our website (a specific page that makes a db connection and displays UP if it worked). If it says UP, we know both the web server and database are working. If it doesn't say up, we know that either the web server or the database is not working and it triggers the fail over. There are software load balancers that can achieve the same thing. Ask your hosting provider if they provide any such service.

Edit for above paragraph: Sorry, I guess I should clarify. The Barracuda's have a "last resort" option for failover. So we have only 1 server configured with 100% traffic going to it for load balancing. Upon failure, it'll use the "last resort" IP address. It's not a typical use case for a load balancer, but it works great for our small setup. We can force a failover to datacenter B if we ever need to do maintenance and then bring it back on demand.

We then use DNS failover as a secondary tier. It monitors the websites in the same way, but we give it a delay of 5 minutes or so because we have found that not everyone's ISP respects DNS TTLs, so you'll eventually get people going to both sites at the same time. So we try to avoid a DNS failover if we can.

Speaking of which in order to properly have it fail back and forth without problems, you'll need some sort of centralized database OR master-master replication. We go with the latter, but it's risky business. It's on my to-do list to re architect the database piece.

At any rate, this set up is good enough for 99.9% to 99.99% uptime which for most small businesses is acceptable.

Safado
  • 4,786
  • 7
  • 37
  • 54