Setting up an Amazon AWS elastic load balancer

If you have multiple Amazon AWS instances that require load balancing you can set this up quite quickly in the management console.

The benefit of having a load balancer is that you can have a single point to connect to, for example pointing a domain name to a load balancer and having several Apache servers sharing the service request load. For DNS services check out Amazon’s Route 53.

You can set up a CNAME record in your public DNS to point a domain name to the Amazon supplied DNS name of the load balancer.

Machine instances can be added or removed from behind the load balancer at any time, easing administrative complexity.

Encryption/decryption can be done at the load balancer, removing this workload from the machine instances and having the management in one central location.

The load balancer can monitor the health of the instances in use and will stop sending service requests to an instance that stops working.

Sticky sessions can be configured so that the duration of a user’s session is bound to one running instance.

Setting up an Amazon AWS elastic load balancer

Log into the Amazon Management Console and browse to Amazon EC2 -> Network & Security -> Load Balancers and select the ‘Create Load Balancer’ option.

This will start a wizard that will help you with the setup. The first screen will prompt you for a load balancer name and the listener configuration. The listener will by default include HTTP traffic on port 80. You can add HTTP, HTTPS, TCP and SSL protocols and specify the external ports to use, i.e. public, and the internal ports to use, i.e. between the load balancer and the machine instances. Set it up and hit Continue.

The next screen of the wizard depends on what you have entered in the listener configuration. For example, if you have selected HTTPS/443 the next screen will prompt for details about the SSL certificate:

Next we will set up health checks that the new load balancer will use to confirm whether an instance is healthy or busted. An instance will be removed from the load balancer once the load balancer thinks that it is in an unhealthy state, in this example two consecutive 5 second timeouts. An instance is regarded healthy again after 10 successful checks.

In this example I have selected only HTTP for the listener protocol on port 80, so the wizard assumes that I will be running a web service and will prepopulate the healthcheck options very nicely:

The next screen lists existing instances that do not already belong to a load balancer. You can select the instances that you want to use with the new load balancer.

The load balancer can have any instance added to it, as long as the instances are in the same region.

The final screen allows you to review the load balancer configuration. There is a subtle warning to check the product page for pricing information. Hit Create when you are happy with your setup.


The newly created load balancer is now available in the management console. Here you can see the DNS name, the status of the instances in service, the port configuration and the security group in use.

It may take a few minutes for the newly created elastic load balancer to appear in your management console, however I have never waited more than a couple of seconds for it to show up.

For more information, read the Aws support article.

Be Sociable, Share!

Related posts:

  1. Setting up an Amazon AWS elastic IP An Elastic IP is a static public IP address that...