-1

I am trying to create high availability application. My current design has two VMs, both have public IPs, both are running in same subnet and both VMs have same web application running in docker. ssl certs and traffic to the app in docker is managed by Traefik. The first VM is master so its ip is updated to Cloudflare. There is a third VM running which has a script which hits the application over IP of first VM to check if it receives response or not. If script does not receives the response from first VM then it send a email notification to notify me of problem and then this script updates the Cloudflare with public ip of second(failover) VM so that traffic goes to second VM.

This design is working all good but it is very rudimentary. I know this can be improved but I am not sure how to make it better so need your suggestions. What I want to do is to run a health check of app on master VM and if it app is not responding for any reason then route the traffic to failover VM. During my research I came across keepalived, I have not looked into it but I think this could be of some help.

enter image description here

  • What hosting are you using? In AWS the standard pattern is to use an application load balancer, pointing at applications in two or more AZs, with health checks validating the applications are available. Your design seems like it might work but may not be optimal. – Tim Dec 12 '21 at 21:02
  • Define improve. How does this not meet what you need it to do? Set aside any neat technology or buzzwords for a moment. – John Mahowald Dec 13 '21 at 01:31
  • 1
    @Tim: I am using oracle cloud. – Sandeep Kumar Dec 13 '21 at 03:58
  • @John: I am using 3rd VM for health monitoring which I think not needed. This piece can be improved. – Sandeep Kumar Dec 13 '21 at 04:02

1 Answers1

0

I suggest you look into using an Oracle load balancer and the integrated health checks, along with autoscaling. I might not be quite right in terms of Oracle and the links might not be correct, but that's how it would be done in AWS and the concepts tend to go across clouds.

Tim
  • 30,383
  • 6
  • 47
  • 77