This project demonstrates the deployment of a multi-tier website using Amazon Web Services (AWS) Elastic Compute Cloud (EC2) instances and Amazon Relational Database Service (RDS). The website consists of a PHP front-end and a MySQL database, with an emphasis on scalability and high availability by leveraging AWS Auto Scaling.
A fictional company, ABC, wants to migrate its product to AWS to take advantage of its scalability and availability. The company’s current setup includes:
- MySQL database
- PHP-based website
The primary goal is to implement high availability for the website by enabling Auto Scaling on the EC2 instances.
The following objectives were addressed in this project:
- Launch EC2 Instances: Deploy multiple EC2 instances to host the PHP website.
- Enable Auto Scaling: Configure Auto Scaling to maintain at least 2 running instances at all times to ensure high availability.
- Create an RDS Instance: Deploy an RDS instance to host the MySQL database.
- Database Setup: Create the database and a table with password-protected access.
- Configure Networking:
- Change the website’s hostname to point to the RDS instance.
- Allow traffic from EC2 instances to the RDS instance.
- Enable all-traffic rules for EC2 instances.
- Amazon EC2: For launching and managing virtual servers to host the website.
- Amazon RDS: For creating and managing the MySQL database in the cloud.
- Elastic Load Balancer: To balance the load on the websites so that auto scaling can be used.
- Auto Scaling: To maintain application availability by automatically adjusting the number of EC2 instances.
- MySQL: To manage the database layer of the application.
- Launch EC2 Instances:
- Created one EC2 instances to serve the PHP website.
- Installed relevant packages such as apache2 (the web server) and MySQL.
- Created an Images of this instance (used in Auto Scaling).
- Networking Configuration:
- Created two security groups to server the following purpose:
- Allow EC2 instances to communicate with the RDS instance.
- Allow all-traffic rules for EC2 instances.
- Created two security groups to server the following purpose:
- Create and Configure RDS:
- Launch an RDS instance.
- Create a database with the requirements specified.
- Configure Website:
- Update the PHP website to use the RDS hostname.
- Set Up Auto Scaling:
- Enable Auto Scaling to ensure a minimum of 2 instances are running at all times.
- Set up Elastic Load Balancer
- Configure an ELB to balance traffic across the EC2 instances.
- The files that were to be used for the website were located on my personal computer. The files also contained some images that had to be uploaded as a part of the website. To resolve this problem, I used FileZilla.
- Earlier, I was using an EC2 template that was exactly the same as the one lauched in the first stage. This template did not contain the required drivers in it and so when using Auto Scaling and Elastic Load Balancer, the system was failing. To resolve the problem, I created an image of the EC2 instance with the required drivers installed and used it as a template for Auto Scaling.
This project successfully demonstrates the deployment of a multi-tier web application using AWS services, ensuring high availability and scalability using EC2, Auto Scaling, ELB, and RDS.