Day 47: Test Knowledge on AWS
Test Knowledge on AWS Diagram.

Day 47: Test Knowledge on AWS


No alt text provided for this image
Diagram

Dear Learners in Today topic we will discuss on AWS Test Knowledge with the help of 3 tasks:

Task-01

Launch an EC2 instance using the AWS Management console and connect to it using SSH.

Login the AWS account with username and password

Click on the "Launch Instance" button to start the instance creation process.

No alt text provided for this image
Click on the "Launch Instance"

Select an Amazon Machine image, I will select the (AMI) to use for the instance.

No alt text provided for this image
Select an Amazon Machine image,

Choose and instance type based on your needs and requirements.

No alt text provided for this image
Choose and instance type Diagram

Configure the instance details such as VPC, subnet,security groups and Storage click on "Launch instance"

No alt text provided for this image
Configure the instance details Diagram.

Now your EC2 instance are created.

No alt text provided for this image
Now your EC2 instance are created.
No alt text provided for this image
Now your EC2 instance are created.

Click on the "Connect" button to view the connections details.

Connect to the instance using the SSH Client of your choice.

No alt text provided for this image
Connect to the instance using the SSH Client of your choice. Diagram.
No alt text provided for this image
Connect to the instance using the SSH Client of your choice.

Need to be install a Web Server on the Ec2 instance and deploy a simple web application.

once connected to the instance, update the package manager and install the web server (for ex- Apache, Nginx). here installed apache server using command.

Syntax:- sudo apt-get install apache2

No alt text provided for this image
Need to be install a Web Server Diagram.

Start the apacher service and check the status of apache service.

syntax:

sudo systemctl start apache2

sudo systemctl status apache2

No alt text provided for this image
sudo systemctl start apache2/ sudo systemctl status apache2 Diagram

Go to the inside directory

cd /var/www/html

No alt text provided for this image
Go to the inside directory cd /var/www/html Diagram.

create a new index.html file which is simple html file contain simple form.

sudo nano index.html

No alt text provided for this image
Diagram

Copy the public ip which shows simple web application.

No alt text provided for this image
Copy the public ip which shows simple web application. Diagram

After these process, Create a Amazon CloudWatch and troubleshoot.

Monitor the Ec2 instance using Amazon CloudWatch and troubleshoot anu issues that rise.

Go to the Amazon CloudWatch dashboard.

Go to the Amazon EC2 console and select the instance you want to monitor.

Click on the "Monitoring" tab and enable "Detailed monitoring"

No alt text provided for this image
Click on the "Monitoring" tab and enable "Detailed monitoring" Diagram.
No alt text provided for this image
Diagram

Go to the Amazon Cloud watch console and select the "Metrics page".

Click on the "EC2" tab to view the available EC2 metrics.

Select the metric you want to monitor. For example, you monitor the CPU usage, memory usage,disk I/O network traffice. Click on Pre-instance Metrics.

No alt text provided for this image
Select the metric you want to monitor Diagram.
No alt text provided for this image
Diagram

Configure the CloudWatch alarm for the selected metric.

Click on the "Create Alarm" button to set up an alarm.

No alt text provided for this image
Click on the "Create Alarm" button to set up an alarm. Diagram

Select the metric you want to monitor.

No alt text provided for this image
Select the metric you want to monitor. Diagram.

Choose the EC2.

No alt text provided for this image
Choose the EC2 Diagram.

Click on the "Pre-Instance Metrics"

No alt text provided for this image
Diagram

Select the metric CPU utilzation.

No alt text provided for this image
Click on the "Pre-Instance Metrics" Diagram.

Choose the condition that will trigger an alarm (for ex- when the cpu utilisation is above a certain threshold for a certain amount of time).

No alt text provided for this image
Choose the condition that will trigger an alarmDiagram

below thershold limit is 50

No alt text provided for this image
below thershold limit is 50Diagram
No alt text provided for this image
Diagram

Set up additional alarm parameters such as name,description, and notification settings.

No alt text provided for this image
Diagram

Create an alarm.

No alt text provided for this image
Set up additional alarm parameters such as name,description Diagram.

your alarm is created now.

No alt text provided for this image
your alarm is created now. Diagram,

If an alarm is triggered, go to the CloudWatch dashboard to view the metrics and logs for the instance.

Task-02

Create an Auto Scaling group using the AWS Management console and configure it to launch EC2 instance to response to change in demand.

Go to the Launch instances, select the image and templates.

First create "Launch template" form ec2 instance.

No alt text provided for this image
First create "Launch template" form ec2 instance. Diagram.
No alt text provided for this image
First create "Launch template" form ec2 instance. Diagram.

Launch template is created.

No alt text provided for this image
Launch template is created. Diagram.

Click on the "Create Auto scaling group" highlight in orange colour.

No alt text provided for this image
Click on the "Create Auto scaling group Diagram.

Select the launch template to use for the instance in the group.

No alt text provided for this image
Select the launch template to use for the instance in the group. Diagram.

Choose the instance type and other configuration details such as VPC,subnet,security groups and storage.

No alt text provided for this image
Choose the instance type and other configuration Diagram.

Set up the Scaling policies to determine when to launch new instances configured desired,minimum and maximum capacity of instance.

No alt text provided for this image
Diagram

Select the Target tracking scaling policy and choose metric type to cpu utilisation which will create an alarm.

No alt text provided for this image
Select the Target tracking scaling policyDiagram.

Click on "create auto scaling group'.

No alt text provided for this image
Click on "create auto scaling group'. Diagram.

Auto-Scaling group is created.

No alt text provided for this image
Auto-scaling group is created. Diagram.

Use Amazon Cloud watch to monitor the performance of the Auto scaling group ans the Ec2 instance and troubleshoot any issues that rise.

Target tracking policy in autoscaling create 2 alarms with 2 different 2 conditions.

No alt text provided for this image
Target tracking policy in autoscaling create 2 alarms with 2 different 2 conditions. diagram.

Go to the auto-scaling group that we created click on the Monitoring tab and enable "Auto scaling group metric".

No alt text provided for this image
Go to the auto-scaling group that we created click on the Monitoring tab and enable "Auto scaling group metric". Diagram.

you can also create alarm by going to cloudwatch dashboard.

Click on the Create Alarm button to set up an alarm.

No alt text provided for this image
Click on the Create Alarm button to set up an alarm. Diagram

Click on Ec2.

No alt text provided for this image
Diagram

Click on By Auto scaling Group.

No alt text provided for this image
Click on 'By Auto Scaling Group' Diagram.

Choose the metric you want to monitor. you can search for the metric by name.

No alt text provided for this image
Choose the metric you want to monitor. you can search for the metric by name.Diagram

Select any metric which you want to monitor and create an alarm.

No alt text provided for this image
Select any metric which you want to monitor and create an alarm. Diagram.

Once the alarm is created it will start monitoring the specified metric and trigger configured action. you can view the status of the alarm in the cloudwatch console.


Use the AWS CLI to view the state of the Autoscaling group and the Ec2 instances and verify that the correct number of instance are running.

Install and configure the AWS CLI on your local machine.

Install AWS CLI using command.

sudo apt-get update -y

Syntax:- sudo apt-get install awscli

No alt text provided for this image
sudo apt-get update -y/ sudo apt-get install awscli Diagram

aws configure

AWS Access key ID [ ]

AWS Secret Access key [ ]

Default region name [ ]

Default output format json

No alt text provided for this image
aws configure AWS Access key ID [ ] AWS Secret Access key [ ] Default region name [ ] Default output format json Diagram.

Use the below commands to view the state of the Autoscaling group and the instances running in it.

sudo autoscaling describe-auto-scaling-groups.

No alt text provided for this image
Autoscaling group and the instances running in it. sudo autoscaling describe-auto-scaling-groups. diagram

Now at the end you see there are 2 instances running which is launched by auto-scaling group because we choose desired capacity value is 2.

Use the below command to view the state of the Ec2 instance launched by the Auto Scaling group.

Syntax:-

No alt text provided for this image
Use the below command to view the state of the Ec2 instance launched by the Auto Scaling group Diagram.


aws ec2 describe-instances        

Verify that the correct No of instances are running and that they are healthy and functioning properly.

No alt text provided for this image
Verify that the correct No of instances are running Diagram

Thank you for Reading !!

Hope I helped you in understanding the concept in a better way.

Happy Learning


Next Topic:

Day 48 ECS in AWS







Abhisek Moharana

Dynatrace Associate || TCSer || DevOps Enthusiast

1 年

Well explained Maninder Singh

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

Maninder Singh的更多文章

  • Artificial Intelligence for DevOps Engineer

    Artificial Intelligence for DevOps Engineer

    Dear learners, In today article we will explain the Artificial Intelligence for the DevOps Engineers. Important Aspects…

    12 条评论
  • Bash Shell Scripting:- Lesson 7,8 &9 for DevOps Engineers.

    Bash Shell Scripting:- Lesson 7,8 &9 for DevOps Engineers.

    Dear Learners, In Today Topic, We will learn the Shell Scripting form Basics to Advanced for DevOps Engineers. Course…

    3 条评论
  • Bash Shell Scripting:- Lesson 4,5 &6 for DevOps Engineers.

    Bash Shell Scripting:- Lesson 4,5 &6 for DevOps Engineers.

    Dear Learners, In Today Topic, We will learn the Shell Scripting form Basics to Advanced for DevOps Engineers. Course…

    3 条评论
  • Bash Shell Scripting:- Lesson 1,2 &3 for DevOps Engineers.

    Bash Shell Scripting:- Lesson 1,2 &3 for DevOps Engineers.

    Dear Learners, In Today Topic, We will learn the Shell Scripting form Basics to Advanced for DevOps Engineers. Course…

    3 条评论
  • EP 2 DevOps:- 2 Tier Application Deployment

    EP 2 DevOps:- 2 Tier Application Deployment

    2-Tier Application Deployment Diagram (Architecture) Dear Learners in today topic we will deploy a 2 Tier Application…

    8 条评论
  • DevOps Engineers:- Docker Cheat Sheet

    DevOps Engineers:- Docker Cheat Sheet

    Dear learner, presented below is a concise yet comprehensive Docker cheat sheet, complete with detailed commands and…

    7 条评论
  • DevOps (Day-90): Ending the challengs

    DevOps (Day-90): Ending the challengs

    Table of Contents: Flashback Self-Impact of Learning Today, We have completed the 90days of DevOps challenge where we…

    16 条评论
  • DevOps (Day-88): Kubernetes Architecture

    DevOps (Day-88): Kubernetes Architecture

    Dear Learner's in today topic we will discuss the Kubernetes Architecture in detail. Table of Contents Kubernetes…

    1 条评论
  • DevOps (Day-87): Argo CD

    DevOps (Day-87): Argo CD

    Dear Learners in today topic we will the discuss the Argo CD in Kubernetes. Table of Contents Challenges with CD into…

    13 条评论
  • DevOps (Day-86): Project-7 Portfolio App

    DevOps (Day-86): Project-7 Portfolio App

    Dear Learners in Today's article we will deploying a Portfolio app on AWS S3 Bucket using GitHub. Table of Contents:…

    10 条评论

社区洞察

其他会员也浏览了