High Availability Architecture
A highly available architecture involves multiple components working together to ensure uninterrupted service during a specific period. This also includes the response time to users’ requests. Namely, available systems have to be not only online, but also responsive.
So, Here in this article, we will :
- Create High Availability Architecture with AWS CLI
The architecture includes-
1. Webserver configured on EC2 Instance
2.Document Root(/var/www/html) made persistent by mounting on EBS Block Device.
3. Static objects used in code such as pictures stored in S3
4.Setting up Content Delivery Network using CloudFront and using the origin domain as S3 bucket.
5. Finally place the Cloud Front URL on the webapp code for security and low latency.
Let’s begin
Creating IAM user so that we can use AWS CLI
Installing the AWS CLI
➡️ First we need to download and install the AWS CLI software:https://awscli.amazonaws.com/AWSCLIV2.msi
After the installation is complete we need to configure our CLI by provisioning it with the access and secret key to authenticate our account. The access and secret key can be obtained in the security settings for root user (not-preferred) or by creating an IAM user for the same purpose (preferred). We also need to specify the availability zone in which we want to work.
STEP-1: Configure Webserver on EC2 Instance
Creating EC2 volume
let’s verify from aws portal if volume is created or not
Now install httpd and start the services
yum install httpd -y
systemctl start httpd
STEP-2: Create EBS Block Device and mount the document root on it and make it persistent.
Creating EBS volume:
Attaching EBS to EC2 instance:
Checking the volume got attached properly or not
Creating partition of 1 GiB
Mounting the 1GiB partition(/dev/xvdf1) above created to document root of httpd(/var/www/html/)
STEP-3: Create S3 and store Static Objects like pictures
Creating S3
Keeping object(picture-file) in bucket(folder)
Giving public access to the bucket
Here is the object:
STEP-4: Setting up Content Delivery Network using CloudFront and using the origin domain as S3 bucket.
Creating cloudfront distribution
STEP-5: Finally place the Cloud Front URL on the webapp code for security and low latency.
here is our index page:
<html>
<h1> ARTH-Task6 DONE</h1>
<center>
<img src=”https://d1e8igbortgg2z.cloudfront.net/photo-1548438294–1ad5d5f4f063.jpg” width=”400" height=”300">
</center>
</html>
Thankyou! keep learning! keep growing! keep sharing!
Krithika Sharma
If you enjoyed this, follow me on Medium for more
Let’s connect on LinkedIn