Amazon Web Services in Action PDF Free Download


Presentation Description

Copy/Paste the download link: ==== This book introduces the most important AWS services and how you can combine them to get the most out of Amazon Web Services. Amazon Web Services in Action focuses on Linux as the operating system for virtual servers in the book. Examples are based on open source software whenever possible. ==== Tags: amazon web services in action, amazon web services in action book, amazon web services in action ebook, amazon web services in action pdf, amazon web services in action pdf download, aws service in action, Wittig


Presentation Transcript

slide 2:

Amazon Web Services in Action PDF Epub Free Download Download for free: This book introduces the most important AWS services and how you can combine them to get the most out of Amazon Web Services. Tags: amazon web services in action amazon web services in action book amazon web services in action ebook amazon web services in action pdf amazon web services in action pdf download aws service in action Wittig

slide 3:

Amazon Web Services in Action MICHAEL WITTIG ANDREAS WITTIG MANNING Shelter Island Licensed to Thomas Snead

slide 4:

v brief contents PART 1GETTING STARTED ............................................................1 1 ■ What is Amazon Web Services 3 2 ■ A simple example: WordPress in five minutes 34 PART 2BUILDING VIRTUAL INFRASTRUCTURE WITH SERVERS AND NETWORKING...........................................................51 3 ■ Using virtual servers: EC2 53 4 ■ Programming your infrastructure: the command line SDKs and CloudFormation 91 5 ■ Automating deployment: CloudFormation Elastic Beanstalk and OpsWorks 124 6 ■ Securing your system: IAM security groups and VPC 152 PART 3STORING DATA IN THE CLOUD.........................................183 7 ■ Storing your objects: S3 and Glacier 185 8 ■ Storing your data on hard drives: EBS and instance store 204 Licensed to Thomas Snead

slide 5:

BRIEF CONTENTS vi 9 ■ Using a relational database service: RDS 225 10 ■ Programming for the NoSQL database service: DynamoDB 253 PART 4ARCHITECTING ON AWS................................................279 11 ■ Achieving high availability: availability zones auto-scaling and CloudWatch 281 12 ■ Decoupling your infrastructure: ELB and SQS 310 13 ■ Designing for fault-tolerance 331 14 ■ Scaling up and down: auto-scaling and CloudWatch 363 Licensed to Thomas Snead

slide 6:

Part 1 Getting started Have you watched a blockbuster on Netflix bought a gadget on Ama- or synced files with Dropbox today If so you’ve used Amazon Web Services AWS in the background. As of December 2014 AWS operated 1.4 mil- lion servers and therefore is a big player in the cloud computing market. The data centers of AWS are distributed throughout the United States Europe Asia and South America. But the cloud doesn’t consist of hardware and computing power alone. Software is part of every cloud platform and makes the difference for you as a customer. The information technology research firm Gartner has classified AWS as a leader in the Magic Quadrant for Cloud Infrastructure as a Service in 2015 for the fourth time. The speed and quality of innovation on the AWS platform is extremely high. The first part of this book will guide you through your first steps with AWS and give you an idea of how you can use AWS to improve your IT infrastructure. Chapter 1 introduces cloud computing and AWS you’ll learn about key concepts and basics. Chapter 2 brings Amazon Web Service into action you’ll dive into a complex cloud infrastructure with ease. Licensed to Thomas Snead

slide 7:

3 What is Amazon Web Services Amazon Web Services AWS is a platform of web services offering solutions for computing storing and networking at different layers of abstraction. You can use these services to host web sites run enterprise applications and mine tremendous amounts of data. The term web service means services can be controlled via a web interface. The web interface can be used by machines or by humans via a graphical user interface. The most prominent services are EC2 which offers virtual servers and S3 which offers storage capacity. Services on AWS work well together you can use them to replicate your existing on-premises setup or design a new setup from scratch. Services are charged for on a pay-per-use pricing model. This chapter covers ■ Overview of Amazon Web Services ■ Benefits of using Amazon Web Services ■ Examples of what you can do with Amazon Web Services ■ Creating and setting up an Amazon Web Services account Licensed to Thomas Snead

slide 8:

4 CHAPTER 1 What is Amazon Web Services As an AWS customer you can choose among different data centers. AWS data cen- ters are distributed in the United States Europe Asia and South America. For exam- ple you can start a virtual server in Japan in the same way you can start a virtual server in Ireland. This enables you to serve customers worldwide with a global infrastructure. The map in figure 1.1 shows the data centers available to all customers. In more general terms AWS is known as a cloud computing platform. 1 1.1 What is cloud computing Almost every IT solution is labeled with the term cloud computing or just cloud nowa- days. A buzzword may help to sell but it’s hard to work with in a book. Cloud computing or the cloud is a metaphor for supply and consumption of IT resources. The IT resources in the cloud aren’t directly visible to the user there are layers of abstraction in between. The level of abstraction offered by the cloud may vary from virtual hardware to complex distributed systems. Resources are available on demand in enormous quantities and paid for per use. 1 Bernard Golden “Amazon Web Services AWS Hardware” For Dummies Which hardware powers AWS AWS keeps secret the hardware used in its data centers. The scale at which AWS operates computing networking and storage hardware is tremendous. It probably uses commodity components to save money compared to hardware that charges ex- tra for a brand name. Handling of hardware failure is built into real-world processes and software. 1 AWS also uses hardware especially developed for its use cases. A good example is the Xeon E5-2666 v3 CPU from Intel. This CPU is optimized to power virtual servers from the c4 family. Germany Ireland Japan Brazil Australia Singapore U.S. East U.S. West 1 U.S. West 2 Figure 1.1 AWS data center locations Licensed to Thomas Snead

slide 9:

5 What can you do with AWS Heres a more official definition from the National Institute of Standards and Technology: Cloud computing is a model for enabling ubiquitous convenient on-demand network access to a shared pool of configurable computing resources e.g. networks servers storage applications and services that can be rapidly provisioned and released with minimal management effort or service provider interaction. —The NIST Definition of Cloud Computing National Institute of Standards and Technology Clouds are often divided into the following types: ■ Public—A cloud managed by an organization and open to use by the general public ■ Private—A cloud that virtualizes and shares the IT infrastructure within a single organization ■ Hybrid—A mixture of a public and a private cloud AWS is a public cloud. Cloud computing services also have several classifications: ■ Infrastructure as a service IaaS—Offers fundamental resources like computing storage and networking capabilities using virtual servers such as Amazon EC2 Google Compute Engine and Microsoft Azure virtual machines ■ Platform as a service PaaS—Provides platforms to deploy custom applications to the cloud such as AWS Elastic Beanstalk Google App Engine and Heroku ■ Software as a service SaaS—Combines infrastructure and software running in the cloud including office applications like Amazon WorkSpaces Google Apps for Work and Microsoft Office 365 The AWS product portfolio contains IaaS PaaS and SaaS. Let’s take a more concrete look at what you can do with AWS. 1.2 What can you do with AWS You can run any application on AWS by using one or a combination of services. The examples in this section will give you an idea of what you can do with AWS. 1.2.1 Hosting a web shop John is CIO of a medium-sized e-commerce business. His goal is to provide his custom- ers with a fast and reliable web shop. He decided to host the web shop on-premises and three years ago he rented servers in a data center. A web server handles requests from customers and a database stores product information and orders. John is evalu- ating how his company can take advantage of AWS by running the same setup on AWS as shown in figure 1.2. Licensed to Thomas Snead

slide 10:

6 CHAPTER 1 What is Amazon Web Services John realized that other options are available to improve his setup on AWS with addi- tional services: ■ The web shop consists of dynamic content such as products and their prices and static content such as the company logo. By splitting dynamic and static content John reduced the load for his web servers and improved performance by delivering the static content over a content delivery network CDN. ■ John uses maintenance-free services including a database an object store and a DNS system on AWS. This frees him from managing these parts of the system decreases operational costs and improves quality. ■ The application running the web shop can be installed on virtual servers. John split the capacity of the old on-premises server into multiple smaller virtual serv- ers at no extra cost. If one of these virtual servers fails the load balancer will send customer requests to the other virtual servers. This setup improves the web shop’s reliability. Figure 1.3 shows how John enhanced the web shop setup with AWS. John started a proof-of-concept project and found that his web application can be transferred to AWS and that services are available to help improve his setup. 1.2.2 Running a Java EE application in your private network Maureen is a senior system architect in a global corporation. She wants to move parts of the business applications to AWS when the company’s data-center contract expires in a few months to reduce costs and gain flexibility. She found that it’s possible to run enterprise applications on AWS. Database Web server Maintenance free On-premises server Database Web server Managed by you with updates monitoring and so on Internet User Figure 1.2 Running a web shop on-premises vs. on AWS Licensed to Thomas Snead

slide 11:

363 Scaling up and down: auto-scaling and CloudWatch Suppose you’re organizing a party to celebrate your birthday. How much food and drink do you need to buy Calculating the right numbers for your shopping list is difficult: ■ How many people will actually attend You received several confirmations but some guests will need to cancel at short notice or show up without letting you know in advance so the number of guests is vague. This chapter covers ■ Creating an auto-scaling group with launch configuration ■ Using auto-scaling to adapt the number of virtual servers ■ Scaling a synchronous decoupled app behind an ELB ■ Scaling an asynchronous decoupled app using SQS ■ Using CloudWatch alarms to modify an auto-scaling group Licensed to Thomas Snead

slide 12:

364 CHAPTER 14 Scaling up and down: auto-scaling and CloudWatch ■ How much will your guests eat and drink Will it be a hot day with everybody drinking a lot Will your guests be hungry You need to guess the demand for food and drink based on experiences from previous parties. Solving the equation is a challenge because there are many unknown factors. Behav- ing as a good host you’ll order more food and drink than needed to have a solid buf- fer and no guest will be hungry or thirsty for long. Planning to meet future demands is nearly impossible. To prevent a supply gap you need to add extra capacity on top of the planned demand to prevent running short of resources. The same was true when we planned the capacity of our IT infrastructure. When procuring hardware for a data center we always had to buy hardware based on the demands of the future. There were many uncertainties when making these decisions: ■ How many users would need to be served by the infrastructure ■ How much storage would the users need ■ How much computing power would be required to handle their requests To avoid supply gaps we had to order more or faster hardware than needed causing unnecessary expenses. On AWS you can use services on demand. Planning capacity is less and less impor- tant. Scaling from one server to thousands of servers is possible. Storage can grow from gigabytes to petabytes. You can scale on demand thus replacing capacity plan- ning. The ability to scale on demand is called elasticity by AWS. Public cloud providers like AWS can offer needed capacity with a short waiting time. AWS is serving a million customers and at that scale it isn’t a problem to provide you with 100 additional virtual servers within minutes if you need them suddenly. This allows you to address another problem: typical traffic patterns as shown in figure 14.1. Think about the load on your infrastructure during the day versus at night on a week- day versus the weekend or before Christmas versus the rest of year. Wouldn’t it be nice if you could add capacity when traffic grows and remove capacity when traffic shrinks In this chapter you’ll learn how to scale the number of virtual servers based on current load. 12am 6pm 6am System load System load Thursday Sunday Monday System load December January Figure 14.1 Typical traffic patterns for a web shop Licensed to Thomas Snead

slide 13:

365 Managing a dynamic server pool Scaling the number of virtual servers is possible with auto-scaling groups and scaling poli- cies on AWS. Auto-scaling is part of the EC2 service and helps you to scale the number of EC2 instances needed to fulfill the current load of your system. We introduced auto- scaling groups in chapter 11 to ensure that a single virtual server was running even if an outage of an entire data center occurred. In this chapter you’ll learn how to use a dynamic server pool: ■ Using auto-scaling groups to launch multiple virtual servers of the same kind ■ Changing the number of virtual servers based on CPU load with the help of CloudWatch ■ Changing the number of virtual servers based on a schedule to be able to adapt to recurring traffic patterns ■ Using a load balancer as an entry point to the dynamic server pool ■ Using a queue to decouple the jobs from the dynamic server pool There are two prerequisites for being able to scale your application horizontally which means increasing and decreasing the number of virtual servers based on the current workload: ■ The servers you want to scale need to be stateless. You can achieve stateless servers by storing data with the help of a service like RDS SQL database DynamoDB NoSQL database or S3 object store instead of storing data on local or network-attached disks that are only available to a single server. ■ An entry point to the dynamic server pool is needed to be able to distribute the workload across multiple servers. Servers can be decoupled synchronously with a load balancer or asynchronously with a queue. We introduced the concept of the stateless servers in part 3 of this book and explained how to use decoupling in chapter 12. You’ll return to the concept of the stateless server and also work through an example of synchronous and asynchronous decou- pling in this chapter. 14.1 Managing a dynamic server pool Imagine that you need to provide a scalable infrastructure to run a web application such as a blogging platform. You need to launch uniform virtual servers when the number of requests grows and terminate virtual servers when the number of requests shrinks. To adapt to the current workload in an automated way you need to be able to launch and Examples are 100 covered by the Free Tier The examples in this chapter are completely covered by the Free Tier. As long as you don’t run the examples for longer than a few days you won’t pay anything. Keep in mind that this only applies if you created a fresh AWS account for this book and nothing else is going on in your AWS account. Try to complete the examples of the chapter within a few days you’ll clean up your account at the end of each example. Licensed to Thomas Snead

slide 14:

366 CHAPTER 14 Scaling up and down: auto-scaling and CloudWatch terminate virtual servers automatically. The configuration and deployment of the blog- ging platform needs to be done during bootstrapping without human interaction. AWS offers a service to manage such a dynamic server pool called auto-scaling groups. Auto-scaling groups help you to ■ Run a desired number of virtual servers that can be adjusted dynamically ■ Launch configure and deploy uniform virtual servers As figure 14.2 shows auto-scaling consists of three parts: ■ A launch configuration that defines the size image and configuration of virtual servers ■ An auto-scaling group that specifies how many virtual servers need to be running based on the launch configuration ■ Scaling policies that adjust the desired number of servers in the auto-scaling group Because the auto-scaling group references a launch configuration you need to create a launch configuration before you can create an auto-scaling group. If you use a template as you will in this chapter this dependency will be resolved by CloudFormation automatically. Define the maximum and minimum number of servers. Update the desired number of virtual servers as needed. Min/max/desired number of virtual servers Auto-scaling group Trigger the launch of virtual server. Terminate virtual servers. Multiple virtual servers need to be stateless and decoupled. Template and configuration for virtual servers Launch configuration Auto-scaling defines a dynamic server pool and consists of an auto-scaling group and a launch configuration. Monitor the health of virtual servers by checking the instance state or the health of the application. Launch a virtual server based on the template from the launch configuration. Figure 14.2 Auto-scaling consists of an auto-scaling group and a launch configuration launching and terminating uniform virtual servers. Licensed to Thomas Snead

slide 15:

367 Managing a dynamic server pool If you want multiple servers to handle a workload it’s important to start identical vir- tual servers to build a homogeneous foundation. You use a launch configuration to define and configure new virtual servers. Table 14.1 shows the most important param- eters for a launch configuration. After you create a launch configuration you can create an auto-scaling group refer- encing it. The auto-scaling group defines the maximum minimum and desired num- ber of virtual servers. Desired means this number of servers should be running. If the current number of servers is below the desired number the auto-scaling group will add servers. If the current number of servers is above the desired number servers will be terminated. The auto-scaling group also monitors whether EC2 instances are healthy and replaces broken instances. Table 14.2 shows the most important parameters for an auto-scaling group. If you specify multiple subnets with the help of VPCZoneIdentifier for the auto- scaling group EC2 instances will be evenly distributed among these subnets and thus among availability zones. Table 14.1 Launch configuration parameters Name Description Possible values ImageId Image from which to start a virtual server ID of Amazon Machine Image AMI InstanceType Size for new virtual servers Instance type such as t2.micro UserData User data for the virtual server used to execute a script during bootstrapping BASE64-encoded String KeyName Name of the SSH key pair Name of an EC2 key pair AssociatePublicIpAddress Associates a public IP address with the virtual server True or false SecurityGroups Attaches security groups to new virtual servers List of security group names IamInstanceProfile Attaches an IAM instance profile linked to an IAM role Name or Amazon Resource Name ARN an ID of an IAM instance profile SpotPrice Uses a spot instance instead of an on- demand instance with the maximum price Maximum price for the spot instance per hour such as 0.10 EbsOptimized Enables EBS optimization for the EC2 instance offering a dedicated throughput to EBS root volumes with the IOPS defined in the image AMI True or false Licensed to Thomas Snead

authorStream Live Help