However, upgrading a software version requires downtime (even if it minimal).
What should we do?
The answer is simple: follow the following process and gain a highly available system based on load balancing and session off loading, as well as a no downtime procedure to upgrade your system.
Keep Your Site Up and Running @ AWS
- Place more than a single web instance behind a load balancer. The Elastic Load Balancer (ELB) will be fine for that.
- Make sure you are using session offloading in your system implementation.
- Install elbcli on your machine sudo apt-get -y install elbcli
- Create a credentials file /var/keys/aws_credential_file and secure it sudo chmod 600 /var/keys/aws_credential_file
AWSAccessKeyId=AKIAblablabla
AWSSecretKey=blablablablablablablablabla - Upgrade the servers one after the another.
- Before upgrading a server, take it out of the ELB
sudo elb-deregister-instances-from-lb MyLoadBalancer --instances i-4e05f721 --aws-credential-file=/var/keys/aws_credential_file - And after completing the server upgrade take it back in.
sudo elb-register-instances-with-lb MyLoadBalancer --instances i-4e05f721 --aws-credential-file=/var/keys/aws_credential_file
Bottom Line
A simple process and careful design will keep you system up and running.
Keep Performing,