This is an experimental project to host multiple instance of a webserver in AWS and access its services using ELB.
You can visit http://whatsupdoc-998411791.ap-northeast-1.elb.amazonaws.com/
- Three t2.micro EC2 Instance
- Software Stack : Ubuntu 14.04 OS + NGNIX + Wordpress (with AWS/S3 plug-ins)
- One instance for development and staging. Code base is maintained in git hub.
- Two instances for running webserver instances
- Static content are stored in the each instance's storage (EBS)
- Dynamic content are stored in S3 bucket (user-upload) and in RDS mysql database;
Note : Architecture Diagram is available in doc folder
- Git clone code base to Development server
- Do the coding development
- do the testing on development server's public DNS IP
- push the code to Git hub
- Generate new AMI image
- Create new Instances out of this new AMI
Note : Instead of steps #5& #6, we can push the changes to all the running instances through scripts and s3fs-fuse shared folder or use OpsWorks Both these options I am yet to try.
I have chosen NGNIX as Webserver and Wordpress as CMS.
-
Create an AWS Account
-
Choose a Region and create a VPC and separate subnet for each available zones
-
Create separate security group for Development Instance, Webserver Instances, RDS , ELB
-
Create a RDS , create database, username, password and assign RDS-SG
-
Create a S3 Bucket to store user uploaded content in webserver and share across instances
-
Create a Development server Instance (t2-micro, Ubuntu)
-
Download the whatsupdoc git repo and run the install.sh script to install the software bundle(nginx,mysql,php wordpress etc)
-
verify if the webserver is accessible from public and complete the wordpress installation
-
Create AMI image out of Development server
-
start two instances in separate available zones. Assign the respective subnet and security group.
-
Create ELB Load balance and assign the two instances to it
-
update RDS database entries if need to update the hostname as ELB url instead of development server url
-
verify if accessing ELB's public dns url reaches the webpages
-
Run load balance traffic testing (curl-loader) on any linux based machine. Update the URL in the conf file before running.
Check the cloudwatch metrics to see if both webserver instances are load shared./curl-loader -f bulk.conf