Professional Documents
Culture Documents
Measuring Availability
We can classify systems and evaluate their expected availability by system type. Mission-critical
and business-critical applications such as e-mail and Internet servers probably require a
significantly greater availability than do applications that have a smaller number of users. As
well, some systems could have a continuous (24 hours a day, seven days a week) uptime
requirement, while others such as a stock market tracking system will have nearly continuous
uptime requirements for specific time frames, such as when a stock market is open.
The software industry generally measures availability by using two types of metrics
(measurements):
The industry focuses on mean time to recover (MTTR) issues and investigates how to optimally
design systems to reduce these. MTBF is generally more applicable to hardware availability
metrics
We can design Real Application Clusters to avoid single points-of-failure, component failures
might not necessarily result in application unavailability. Hence, Real Application Clusters can
greatly reduce the mean time between failures(MTBF) from an application availability
standpoint.
Downtime can be either planned or unplanned.They can be broadly classified as system faults,
data and media errors, and site outages. This unplanned downtime is disruptive because it is
difficult to predict its timing.
Unplanned Downtime
A well designed Real Application Clusters system has redundant components that protect
against most failures and that provide an environment without single points-of-failure. Working
with our hardware vendor is key to building fully redundant cluster environments for Real
Application Clusters.
Planned Downtime
● The failure protection level to ensure against a long list of potential causes of failures
Capacity Planning
High availability requires the timely processing of transactions for a system to be deemed
completely available. While this chapter does not provide extended capacity planning
discussions, adequate system resources for managing application growth are important for
maintaining availability.Real Application Clusters enables us to add nodes to our system to
increase capacity and handle application growth. We can do this with minimal interference to
existing client transactions.
Redundancy Planning
● AZs are distinct geographical locations that are engineered to be insulated from
failures in other AZs.
● Regions and AZs help achieve greater fault tolerance by distributing the application
geographically and help build multi-site solutions.
● AZs provide inexpensive, low latency network connectivity to other Availability
Zones in the same Region
● By placing EC2 instances in multiple AZs, an application can be protected from
failure at a single data center
● It is important to run independent application stacks in more than one AZ, either in
the same region or in another region, so that if one zone fails, the application in the
other zone can continue to run.
Auto Scaling
● Auto Scaling helps to automatically scale EC2 capacity up or down based on defined
rules.
● Auto Scaling also enables addition of more instances in response to an increasing
load; and when those instances are no longer needed, they will be automatically
terminated.
● Auto Scaling enables terminating server instances at will, knowing that replacement
instances will be automatically launched.
● Auto Scaling can work across multiple AZs within an AWS Region
● Assign a name to the AMI, description and activate the option “No reboot”, the latter to
prevent the instance from restarting when creating the AMI.
● Verify that the AMI has been created successfully, select “AMIs” from the side menu.
● Check that the “Status” is “available”.
● The next step is to create the Auto Scaling Group; select “Launch Configurations” from
the side menu.
●
● Click on “Create AWS Auto Scaling Group”.
●
● Press “Create Launch Configuration”.
● Select “My AMIs” and the previously created AMI.
● Select the type of instance desired for the slave instances (slaves) created by the Auto
Scaling Group and press “Next: Configure details”.
● Select the option “Select an existing security group” to assign the same Security Group
of the master instance.
● Check that the settings are correct and create the launch configuration by pressing
“Create launch configuration”.
● Choose an existing key and accept that we have access to it; create the launch
configuration.
● The next thing is to configure the Auto Scaling group; Name the group of instances,
determine the number of instances with which it will start, select the VPC and the
private subnet, we also specify that the traffic will come from a Load Balancer so that
the “slave” instances are automatically added to it. Press “Next: Configure scaling
policies.”
● In a few minutes, we can see in “Instances” the instance that is created automatically.
Elastic Load Balancing – ELB
● Elastic Load balancing is an effective way to increase the availability of a system and
distributes incoming traffic to application across several EC2 instances
● With ELB, a DNS host name is created and any requests sent to this host name are
delegated to a pool of EC2 instances
● ELB supports health checks on hosts, distribution of traffic to EC2 instances across
multiple availability zones, and dynamic addition and removal of EC2 hosts from the
load-balancing rotation
● Elastic Load Balancing detects unhealthy instances within its pool of EC2 instances
and automatically reroutes traffic to healthy instances, until the unhealthy instances
have been restored seamlessly using Auto Scaling.
● Auto Scaling and Elastic Load Balancing are an ideal combination – while ELB gives a
single DNS name for addressing, Auto Scaling ensures there is always the right
number of healthy EC2 instances to accept requests.
● ELB can be used to balance across instances in multiple AZs of a region.
Elastic Load Balancing supports two types of load balancers: Application Load Balancers and
Classic Load Balancers.
Route 53
● Amazon Route 53 is a highly available and scalable DNS web service.
● Queries for the domain are automatically routed to the nearest DNS server and thus
are answered with the best possible performance.
● Route 53 resolves requests for our domain name (for example, www.example.com)
to our Elastic Load Balancer, as well as our zone apex record (example.com).
Configuring Route 53
If we don’t have a domain name we can register one for our business in this screen under
Domain registration.
If we already have a domain name we can click Get Started under DNS management.
Now a set of Nameserver (NS) records will get created and assigned for our domain name.
To update login to our domain registrar and choose to add custom nameservers and add these
four NS records.
Once the update is done the requests to our domain name will get routed through Route 53.
Setup DNS Records
These are some commonly used DNS Records to map our domain name to EC2 Instance or
other services.
For example to route our users to view the website in EC2 Instance we need to create an A
record in our DNS zone.
Click Create.
Now we have pointed our domain to our EC2 Instance.
Next we need to create a CNAME record for the www subdomain to point to the Elastic IP
address.
Likewise we can create MX records or TXT records for our domain name.
CloudFront
● CloudFront can be used to deliver website, including dynamic, static and streaming
content using a global network of edge locations.
● Requests for our content are automatically routed to the nearest edge location, so
content is delivered with the best possible performance.
● CloudFront is optimized to work with other Amazon Web Services, like S3 and EC2
● CloudFront also works seamlessly with any non-AWS origin server, which stores the
original, definitive versions of our files.
Configuring CloudFront
Using the AWS Management Console, we will create a CloudFront distribution, and configure it
to serve the S3 bucket we previously created.
● Scroll down to the Distribution Settings section, in the Default Root Object field enter
index.html
● Click Create Distribution.
● To return to the main CloudFront page click Distributions from the left navigation menu.
5. After CloudFront creates our distribution which may take approximately 10 minutes, the
value of the Status column for our distribution will change from In Progress to Deployed.
6. When our distribution is deployed, confirm that we can access our content using our
new CloudFront Domain Name which we can see in the console. Copy the Domain Name
into a web browser to test.
7. we now have content in a private S3 bucket, that only CloudFront has secure access to.
CloudFront then serves the requests, effectively becoming a secure, reliable static
hosting service with additional features available such as custom certificates and
alternate domain names .
Elastic Kubernetes Service
Amazon EKS is a managed service that makes it easy for us to run Kubernetes on AWS
without needing to install and operate our own Kubernetes control plane or worker nodes.
“AWS EKS provides us the cluster which is highly secure and available. It automates key
tasks such as patching, node provisioning, and updates”
● When we set up EKS on AWS, it gives us a control plane that is available across multiple
availability zones, if there is an issue with any of the control planes EKS automatically
detects and replaces those unhealthy control plane nodes, and provides on-demand,
zero downtime upgrades, and patching.
● EKS offers a 99.95% uptime SLA. At the same time, the EKS console provides
observability of our Kubernetes clusters so we can identify any issue quickly and get it
resolved.