Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I update multiple EC2 instances that are load-balanced? [closed]

So, I have been playing around with Amazon Cloud (AWS) and I am trying to figure out how to get files on to all server's if they are load balanced.

At first I thought I could tie 3 different instances to a load-balancer and then have each instance utilize the same volume. That way all I would have to do is update the one volume with the recent build of the site and each instance would then access that. However, I have read that you can't share volumes across instances.

So what is the solution? Would I have to have the three instances all with the same data, and a forth that I could update? Then the forth would replicate the data across the other three.

Just trying to figure out how to update update the production files, and have all servers that are handling the load to pull in the most recent code base.

like image 927
Jeffrey Hunter Avatar asked Mar 21 '11 19:03

Jeffrey Hunter


People also ask

How many instances can a load balancer handle?

Network Load Balancer currently supports 200 targets per Availability Zone. For example, if you are in two AZs, you can have up to 400 targets registered with Network Load Balancer. If cross-zone load balancing is on, then the maximum targets reduce from 200 per AZ to 200 per load balancer.

Which AWS service helps in balancing load across multiple Amazon EC2 instances?

Elastic Load Balancing automatically distributes your incoming traffic across multiple targets, such as EC2 instances, containers, and IP addresses, in one or more Availability Zones.

What does a load balancer do when an instance stops?

If an instance fails the health check a given number of times, the load balancer will stop sending traffic to the instance. The load balancer will continue performing the health check and, if the instance again passes the health check a given number of times, the load balancer will again serve traffic to the instance.


1 Answers

Yes all servers need to have identical content. You could do this by creating an NFS share or similar, and mounting it at the same point on each server. But apparently a decent workaround is to create snapshots of an EBS volume and then mount them on each instance. See http://linuxforlovers.wordpress.com/2009/04/11/sharing-amazon-elastic-block-store-among-multiple-instances/ for more details. Every time you want to commit your changes, you commit to the EBS volume only.

like image 126
James Little Avatar answered Oct 11 '22 19:10

James Little