0 votes
1 view
in AWS by (19.2k points)

my question is simple. Does it make sense to have an Amazon Elastic Load Balancer (ELB) with just one EC2 instance?

If I understood right, ELB will switch traffic between EC2 instances. However, I have just one EC2 instance. So, does it make sense?

On the other hand, I´m using Route 53 to route my domain requests domain.com, and www.domain.com to my ELB, and I don´t see how to redirect directly to my EC2 instance. So, do I need an ELB for routing purposes?

1 Answer

0 votes
by (44.6k points)

You can do both, use it or not use it. First, let me tell you about it without load balancing:

To point your domain name to an EC2 instance:

  • In the EC2 Management Console, select Elastic IP
  • Allocate New Address
  • Associate the address with your EC2 instance
  • Copy the Elastic IP address and use it in your Route 53 sub-domain

The Elastic IP address will be re-associated with a different EC2 instance later if desired.

Later, if you would like to balance between multiple EC2 instances:

  • Create an Elastic Load Balancer
  • Add your instances to the Load Balancer
  • Point your Route 53 sub-domain to the Load Balancer

Now, for a single instance why would you need an ELB. What if your current instance crashes and you want another instance up and running in no time. Then you will need an ELB and you can mention the minimum and maximum instance as 1 so you don’t launch multiple instances.

So, if your instance fails:

  • Auto-scaling will terminate the old instance and launch a new one.
  • The created instance will appear behind the load balancer
  • The user’s traffic will automatically divert to the new instance.

There is no need to change the public DNS or assign Elastic IPs.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...