Reputation: 1
I am using aws server. There is two EC2 instance with same code. How can I set up of load balance so that when one ec2 is down than traffic automatically moves to another ec2 instance.
Upvotes: 0
Views: 1184
Reputation: 31
You can create a classic loadbalancer or an application load balancer depending on your requirement. You can go to AWS console -> Ec2 -> LoadBalancer and create a load balancer from there.
Later you can register both your instances under that load balancer. Create an Alias record for your Loadbalancer and point your application URL or Website URL to the Loadbalancer DNS. This will make sure that the requests coming to to your Load Balancer get distributed among both Ec2 instances equally.
Upvotes: 1