DevOps Learning Notes

  Edwiki Trainings

2 Followers

EC2 Basics


In this lecture you are learning Amazon EC2 Basics.

  1. Linux Architecture
  2. Elastic IP
  3. AWS Support
  4. Service Quota
  5. EC2 Status Checks
  6. EC2 System Logs
  7. EC2 Console Screenshot
  8. Ec2 Pay-As-You-Go

Linux Architecture:

Linux is the system software that can run on Hardware to provide you interface to run applications.

                                    https://edueki-images.sgp1.digitaloceanspaces.com/images/editor-images/220730111523152.jpg

Hardware: Computer hardware includes processor, Ream Memory, Key Board, Monitor, Hard Disk etc... Collectively the integration of these hardware components called System or Server. 

Operating System: Operating System is the interface program between users and computer to request certain tasks to be executed and fulfill the request. Operating System has Kernel as main core program to talk to the hardware in machine language.

Kernel: The kernel is the core component of the operating system. Kernel interacts with hardware to handle the tasks like task scheduling and file management, memory management. 

The kernel is the main component of a Linux OS and is the core interface between a computer’s hardware and its processes such as memory management, process management, device drivers, system calls etc.

Shell: The shell is the utility interacts with the user. Shell will translate the users’ requests to kernel in kernel understanding language/format.  When user type in a command at Linux terminal, the shell interprets the command and calls the program that user want. Operating supports many Shell programs to handle different user requests.

Shell allows the users to communicate with the kernel. It is the interface between kernel and user. 

C Shell, Bourne Shell and Korn Shell are most famous shells which are available with most of the Linux variants.

Applications: Applications are small programs that runs on operating system which are using the Shell to interact with the kernel and fulfill certain services to the users. Applications are like FTP, DNS, Apache HTTP, DHCP used to customize or configure the system for certain use cases.

Users: Who actually uses the system for various needs, users can call the Shell Program directly or can run applications and applications can use Shell programs which interprets the requests to Kernel.

Elastic IP: Elastic IP is a static and reserve public IP address that you can assign to EC2 instance network interfaces. 

  1. An Elastic IP address is static; it does not change over time.
  2. An Elastic IP address is for use in a specific Region only, and cannot be moved to a different Region.
  3. An Elastic IP address comes from Amazon's pool of IPv4 addresses, or from a custom IPv4 address pool that you have brought to your AWS account.
  4. To use an Elastic IP address, you first allocate one to your account, and then associate it with your instance or a network interface.
  5. When you associate an Elastic IP address with an instance, it is also associated with the instance's primary network interface. When you associate an Elastic IP address with a network interface that is attached to an instance, it is also associated with the instance.
  6. When you associate an Elastic IP address with an instance or its primary network interface, the instance's default public IPv4 address (if it had one) is released back into Amazon's pool of public IPv4 addresses. You cannot reuse a public IPv4 address, and you cannot convert a public IPv4 address to an Elastic IP address.
  7. A disassociated Elastic IP address remains allocated to your account until you explicitly release it.
  8. By default, all AWS accounts are limited to five (5) Elastic IP addresses per Region.
  9. To remove/delete any resource in an AWS account, we first need to ensure that particular resource is not being used or associated with other AWS resources. For example, in order to delete EIP, we first need to disassociate it from any attached instance and release it.

EIP Pricing:

  1. To ensure efficient use of Elastic IP addresses, AWS impose a small hourly charge if an Elastic IP address is not associated with a running instance, or if it is associated with a stopped instance or an unattached network interface. 
  2. While your instance is running, you are not charged for one Elastic IP address associated with the instance, but you are charged for any additional Elastic IP addresses associated with the instance.

AWS Support:

AWS Support offers a range of plans that provide access to tools and expertise that support the success and operational health of your AWS solutions.

Follow the LINK to know various AWS support plans available to get support from AWS.

LINK: https://aws.amazon.com/premiumsupport/plans/

Service Quota:

  1. AWS account has default quotas, formerly referred to as limits, for each AWS service. 
  2. Unless otherwise noted, each quota is Region-specific. You can request limit increase for some quotas, and other quotas cannot be increased.

Follow the LINK to raise request with AWS to increase the service limit.

LINK: https://us-east-1.console.aws.amazon.com/servicequotas 

EC2 Status checks:  EC2 instance status checks describes the health of Amazon EC2 instance. Status checks run every minute on your instances and detect the configuration as well as underlying hardware issues.

  1. System status check
    1. Checks against underlying physical hardware.
  2. Instance status check
    1. Checks against Instance OS kernel software and instance configuration.

How to fix System Check failures

If system check failed then you can stop and start the EC2 Instance to fix the issues... AWS determines that the instance will be booted up in the healthy hardware during the stop and start action.

Below are the possible AWS issues why System checks fails:

  1. Network connectivity lost
  2. System power lost
  3. Any hardware replacement issues - Compute, Networking, Disk
  4. The physical host having software issues

How to fix Instance Check failures

If Instance check failed then you need to fix the issues by checking System or Kernel configuration.

Below are the possible reasons why System checks fails:

  1. Failed system status checks
  2. Incorrect networking / startup configuration
  3. Overloaded memory
  4. File system which is Corrupt
  5. Kernel which is Incompatible
  6. OS, Kernel related issues

EC2 System logs:

EC2 System Logs provides instance booting logs to know if any booting related or kernel related issues. 

Follow the below steps to get System Logs

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
  2. In the left navigation pane, choose Instances, and select the instance.
  3. Choose Actions, Monitor and troubleshoot, Get system log.

 

EC2 Console Screenshot: 

EC2 Console screenshot to get the console state and capture the screenshot from AWS. Console Screenshot shows the current state of the system from system console. A healthy Instance shows Login Prompt in the console screenshot.

Follow the below steps to get the Console Screenshot.

  1. Go to EC2 instance dashboard.
  2. In the left navigation pane, choose Instances.
  3. Select the instance to capture.
  4. Choose Actions, Monitor and troubleshoot, Get instance screenshot.
  5. Choose Download, or right-click the image to download and save it.

 

Pay-as-you-Go

  1. Pay as you Go is the cloud offering to allow you to pay only for the utilized resources without doing upfront payments. 
  2. Flexible to do scale up/scale down of compute resources on demand basis and pay for what you utilized.


Previous Next