I reviewed high availability solutions like heartbeat and kept moving to failover when haproxy load balancing goes down. I realized that although we would like to get high availability, at the moment this is not a prerequisite in order to do this in the amount of expenses associated with the fact that two instances of load balancing work at any given time, so that we get instant transfer to another resource (in particular, how one pound will be redundant in our setup).
My alternative solution is to start a new instance of EC2 load balancer from AMI if the current load balancer has stopped working and connected it to the elastic ip that our domain name points to. This should ensure that downtime is limited by the time it takes to start a new instance and associate an elastic ip, which, given our current circumstances, seems like a reasonable cost-effective solution for high availability, especially since we can easily make this multi-av zone. I want to do this by following these steps:
- Prepare AMI load balancer
- Run one instance of ec2 acting as a load balancer and assign it an Elastic IP.
- Ask the microserver to regularly check the current load balancer (we always have an additional microserver that works anyway)
- If ping expires, start a new instance of EC2 using the AMI load balancer
- Link elastic ip to new instance
- Shut down the old instance of load balancing
- Repeat step 3 with a new instance.
I know how to run commands in my script to start and close EC2 instances, bind an elastic IP address to an instance, and a ping server.
My question is what would be a suitable ping here? Is regular ping at regular intervals sufficient, and what would be a good interval? Or is it a rather simplistic approach, and is there a more reasonable health check that I have to do?
Also, if anyone anticipates any problems with this approach, feel free to comment
Jon e source share