Reputation: 2596
I am using AWS EC2 instances for my API server. I want to prevent the server down situation so I plan to use 2 servers (one production and one backup)
I want to config AWS network or add a loadbalancer which could:
I don't know If Is there any feature on AWS could help me to do my plan.
Upvotes: 0
Views: 111
Reputation: 6957
AWS Load balancer doesn't exactly work that way. It distributes the load among all the healthy registered instances.
To maintain high-availability I'd recommend using AWS auto-scaling feature.
Basically, you put your machines behind a load balancer and if any of them starts failing it triggers an event and takes action accordingly. You can start with 2 machines and set the auto-scaling to keep 2 machines running at all times. So if one goes down it just launches another one of the same kind and adds it to the load balancer. You can start with one machine as well but if it goes down there will be some downtime until the new one kicks in. Also you can increase/decrease the number of running instances depending on the traffic you're getting.
Hope this helps to give you an idea.
Upvotes: 1