Building High Availability Architecture with AWS CLI

Building High Availability Architecture with AWS CLI

Welcome you all to my article based on Creating High Availability Architecture with AWS CLI.

Have you ever thought that how data of big Website and websites are accessible from worldwide??Is any tool behind it??

Yes.. By using CloudFront service which is provided by Amazon AWS we can host our website or data worldwide. But what is CloudFront??

Let’s see….

TASK DESCRIPTION:

?Create High Availability Architecture with AWS CLI

?The architecture includes-

??Webserver configured on EC2 Instance

??Document Root(/var/www/html) made persistent by mounting on EBS Block Device.

??Static objects used in code such as pictures stored in S3

??Setting up Content Delivery Network using CloudFront and using the origin domain as S3 bucket.

??Finally place the Cloud Front URL on the webapp code for security and low latency.

??All the above steps must be performed using AWS CLI ??

? For Designing these kind of architecture we are going to Integrate AWS S3 with CloudFront Service of AWS .

Let’s start with basic concept.

What is CloudFront?? ????

Amazon CloudFront is a content delivery network offered by Amazon Web Services. Content delivery networks provide a globally-distributed network of proxy servers which cache content, such as web videos or other bulky media, more locally to consumers, thus improving access speed for downloading the content.

What is Amazon S3??????

Amazon S3 is object storage built to store and retrieve any amount of data from anywhere on the Internet. It’s a simple storage service that offers industry leading durability, availability, performance, security, and virtually unlimited scalability at very low costs.

So Let’s start to our task !!!

TASK COMPLETION:

  1. Firstly we have to launch one EC2 instance for configuration of Webserver.

aws ec2 run-instances --image-id image_id --instance-type instance_type --count no --security-group-ids security_group_id --subnet-id subnet_id --key-name key_name

No alt text provided for this image
No alt text provided for this image

2. Now we have to create on EBS volume of required size.

aws ec2 create-volume — volume-type volume_type — size size — availability-zone name_of_zone

No alt text provided for this image
No alt text provided for this image

We can see our EBS volume is created.Now we want to connect to our created instance.

aws ec2 attach-volume --volume-id volume_id --instance-id instance_id --device device_name

No alt text provided for this image
No alt text provided for this image

3. Now the instance we created , we will ssh into that instance and install httpd..By running command :- ssh -l ec2-user -i keyname.pem public ip of instance

I) Installing httpd package

yum install httpd

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

4. Now we have to create partition to make document root /var/www/html.

I) Creating Partition

fdisk device_name

No alt text provided for this image

As we can see our partition is done. Now we have to format it.

II) Formatting Partition

mkfs.ext4 partition_name

III) Mounting /var/www/html on created partition.

mount partition_name /var/www/html/


No alt text provided for this image

5. Now we have to create one S3 bucket.

aws s3api create-bucket --bucket bucket_name --create-bucket-configuration LocationConstraint=ap-south-1

No alt text provided for this image
No alt text provided for this image

As our bucket is ready to use. Now we have to upload our data inside bucket.

aws s3 sync "location of image " s3://bucket_name --acl public-read

No alt text provided for this image
No alt text provided for this image

6. To access these Image We are now using S3 URL due to these we have to go travel through public Internet Network which may cause some kind of Delay or Latency or may be disconnection . Since Rather than Giving these Image URL we prefer AWS Cloud Front which is one kind of Content Delivery Network which provide one unique URL to S3 Object by which users from anywhere can access or see these content with less latency and fast connectivity via AWS Private CDN and Edge Locations .

To set up Content Deliver Network of AWS We have to create CloudFront Distribution for our S3 Bucket Objects .

aws cloudfront create-distribution --origin-domain-name domain_name

No alt text provided for this image
No alt text provided for this image

7. As CloudFront provides unique URL or Domain name to access our content worldwide with fast speed and low latency.

No alt text provided for this image

This is script. We can see image source is our unique domain name.

Let’s see output……

No alt text provided for this image


要查看或添加评论,请登录

Shreeja Raj的更多文章

  • Shell Scripting

    Shell Scripting

    Shell Scripting is an open-source computer program designed to be run by the Unix/Linux shell. Shell Scripting is a…

  • What is Azure Kubernetes Service?

    What is Azure Kubernetes Service?

    AKS is an open-source fully managed container orchestration service that became available in June 2018 and is available…

    2 条评论
  • Neural Networks and Industry Use Cases

    Neural Networks and Industry Use Cases

    Neural networks ??? Neural networks reflect the behavior of the human brain, allowing computer programs to recognize…

  • Integrating Amazon RDS with WordPress

    Integrating Amazon RDS with WordPress

    Amazon Relational Database Service (RDS) Amazon Relational Database Service (Amazon RDS) makes it easy to set up…

  • What is Kubernetes

    What is Kubernetes

    In a nutshell, Kubernetes is a system for deploying applications and more efficiently utilizing the containerized…

  • 5 Mind-Blowing Ways Facebook Uses Machine Learning

    5 Mind-Blowing Ways Facebook Uses Machine Learning

    What comes first to mind when you think about social networking? It’s Facebook of course! Facebook is actually not even…

  • AWS CASE STUDY

    AWS CASE STUDY

    Millions of customers- including the fastest growing startups, largest enterprises, and leading government agencies -…

  • What is Big Data?

    What is Big Data?

    Big data is a collection of large datasets that cannot be processed using traditional computing techniques. It is not a…

社区洞察

其他会员也浏览了