How to Create Load Balancer In AWS


Prerequisites: Apache web server

STEP 1. Click on Create Load Balancer.

create load balancer page


STEP 2. Specify a Unique Name to your Load Balancer.After that Click on Next:Assign Security Groups.

LoadBalancer basic conf page


  STEP 3. Assign a new or default security group for your Load Balancer. After that Click on Next:Configure Security Settings.

laodbalancer security group assign page

STEP 4. Click Next:Configure Health Check.

loadbalancer configure security setting page

STEP 5. Configure Health Check same as Shown in Below Image.After that click on Next:Add EC2 Instances.

loadbalancer configure health check page

STEP 6. Select your EC2 Instance on which you want to attach a Load Balancer. After that Click on Next:Add Tags.

loadbalancer add ec2 instance page

STEP 7. Define Key Value Of  your Load Balancer. After that Click on Review and Create.

loadbalancer key value page

STEP 8. Review your Load Balancer Settings before Creation.After that Click on Create.

loadbalancer review page

STEP 9. Now go to Load Balancer And see your first Load Balancer.

Load balancer main page

STEP 10. To check your Load Balancer is working properly just run Load Balancer DNS Name Through your Web.

Loadbalancer dns run page

How To Add Multiple Instance In Load Balancer

STEP 11. Select your Load Balancer and Click on Edit Instances.

loadbalancer edit instance page

STEP 12. Add EC2 Instance Which You Want to Attach with Load Balancer.After that Click on Save.

loadbalancer add or remove instance page

STEP 13.  Now check the status of the new Instance,If status is InService it means that instance is Successfully Attach with the Load Balancer.

Load balancer multiple instance state
Note-: Instance status will take few minutes to change from OutOfService to InService.

Step 14. Now we can check our Load Balancer by distributing the Traffic on both instance.For this we have installed  apache2 webserver on one machine and apache2 with php on another machine.

Load Balancer DNS page

Note: Copy LoadBalancer DNS name and Run it through webpage.

Step 15. After Running DNS Through web page refreshing the page repeatedly in return which produces the load on webserver and load balancer will help us to distribute the load over the two machine

LoadBalancer WebRun Page

LoadBalancer WebRun1 Page