Deployment on Amazon cloud with load balancer

What Is Elastic Load Balancing?

Elastic Load Balancing automatically distributes incoming traffic across multiple EC2 instances. we can create a load balancer and register instances with the load balancer in one or more Availability Zones. The load balancer serves as a single point of contact for clients. This enables you to increase the availability of your application. we can add and remove EC2 instances from your load balancer as our needs change, without disrupting the overall flow of information. If an EC2 instance fails, Elastic Load Balancing automatically reroutes the traffic to the remaining running EC2 instances(Ref-From AWS).

 

Architecture:

 

lb-archi

 

 

Please do the following setups to create  load balancer and then  add at least two EC2 instances .

createloadbalcner

 

lb-02

 

lb-03

 

lb-04

 

lb-05

 

Commands(connect to one of the ec2 instances):

  • ssh -i /path/my-key-pair.pem ec2-user@ec2-198-51-100-1.compute-1.amazonaws.com
  • /path/my-key-pair.pem - is where key is located
  • ec2-user - user name
  • Hostname -ec2-198-51-100-1.compute-1.amazonaws.com
Then go into htdocs or your root directory and do the deployment .
after finish that do r-sync to other EC2 instance .
ex: rsync -i /path/my-key-pair2.pem -avz –exclude app/config/database.php –exclude app/routes.php –exclude app/storage /mnt/www/mybitbucket_bkp/ ec2-user@ec2-197-51-101-1.compute-2.amazonaws.com:/mnt/www/my_dev_store/

then please change the configuration to the newly updated server

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s