亚马逊云服务开通指南_亚马逊弹性容器服务初学者指南

亚马逊云服务开通指南

This article is a beginner’s high level look at Amazon ECS. We’ll cover core concepts, terms, simple architecture diagrams, and abstracted examples. So let’s get started!

本文是初学者对Amazon ECS的高级了解。 我们将介绍核心概念,术语,简单的体系结构图和抽象的示例。 因此,让我们开始吧!

码头工人 (Docker)

To appreciate Amazon ECS, you first have to understand Docker.

要欣赏Amazon ECS,您首先必须了解Docker。

Docker is a client-server application that can be installed on Linux, Windows, and MacOS and that allows you to run Docker containers. Containers are lightweight environments containing everything needed to run a specific application or part of an application. Multiple different containers can be run on one machine, so long as it has the Docker software installed.

Docker是一个客户端服务器应用程序,可以安装在Linux,Windows和MacOS上,并允许您运行Docker 容器 。 容器是轻量级环境,其中包含运行特定应用程序或应用程序一部分所需的一切。 只要安装了Docker软件,就可以在一台机器上运行多个不同的容器。

If you’re interested in how they work, and how Docker is different from a virtual machine, then this intro to Docker is a great place to start.

如果您对如何 它们的工作原理,以及Docker与虚拟机的不同之处,那么Docker入门是一个不错的起点。

Using Docker containers allows teams to have a consistent development environment by abstracting away the software, operating system, and hardware configuration into a standard building block that can be run on any machine.

通过使用Docker容器,团队可以将软件,操作系统和硬件配置抽象为可以在任何计算机上运行的标准构件,从而拥有一致的开发环境。

Each container has exactly what it needs — for example, certain versions of a language or library — and no more than it needs. Multiple containers can be used for different parts of your application if you want, and they can be set up to communicate with each other when needed.

每个容器完全具有所需的内容(例如,某种语言或库的版本),仅此而已。 如果需要,可以将多个容器用于应用程序的不同部分,并且可以将它们设置为在需要时相互通信。

By using specified Docker containers to run your production code, you can be sure that your development environment is exactly the same as your production environment.

通过使用指定的Docker容器运行生产代码,可以确保开发环境与生产环境完全相同。

As your application grows, managing the deployment, structure, scheduling, and scaling of these containers rapidly becomes very complicated. This is where a “container management service” comes in. It aims to allow simple configuration options and handles the heavy lifting while you go back to writing the app.

随着应用程序的增长,快速管理这些容器的部署,结构,调度和扩展变得非常复杂。 这是“容器管理服务”的来源。它旨在提供简单的配置选项,并在您重新编写应用程序时处理繁重的工作。

Amazon ECS简介 (An intro to Amazon ECS)

Amazon Elastic Container Service (ECS) is, according to Amazon,

亚马逊表示,Amazon Elastic Container Service (ECS)是,

…a highly scalable, fast, container management service that makes it easy to run, stop, and manage Docker containers on a cluster.

…高度可扩展,快速的容器管理服务,可轻松在集群上运行,停止和管理Docker容器。

It is comparable to Kubernetes, Docker Swarm, and Azure Container Service.

它可与KubernetesDocker SwarmAzure容器服务媲美。

ECS runs your containers on a cluster of Amazon EC2 (Elastic Compute Cloud) virtual machine instances pre-installed with Docker. It handles installing containers, scaling, monitoring, and managing these instances through both an API and the AWS Management Console. It allows you to simplify your view of EC2 instances to a pool of resources, such as CPU and memory. The specific instance a container runs on, and maintenance of all instances, is handled by the platform. You don’t have to think about it.

ECS在预装有Docker的Amazon EC2 (弹性计算云) 虚拟机实例的群集上运行容器。 它通过API和AWS管理控制台处理容器的安装,扩展,监视和管理这些实例。 它使您可以将EC2实例的视图简化为资源池,例如CPU和内存。 容器在其上运行的特定实例以及所有实例的维护由平台处理。 您无需考虑。

It’s worth noting that it is tied into the Amazon infrastructure, unlike some other providers that allow more flexibility. However, that means it comes with excellent integration with other AWS services.

值得注意的是,它与Amazon基础架构绑定在一起,这与其他一些提供更大灵活性的提供商不同。 但是,这意味着它具有与其他AWS服务的出色集成。

条款和架构 (Terms and architecture)

Let’s give some imaginary context for the definitions we are about to look at. Say you are building an application that runs on two Docker containers, perhaps one for the main application, and one for managing metrics. Both are needed for the application to run as intended. If you had large amounts of traffic, you might need to run several pairs of containers.

让我们为我们将要看的定义提供一些假想的上下文。 假设您正在构建一个在两个Docker容器上运行的应用程序,也许一个用于主应用程序,另一个用于管理指标。 两者都是应用程序按预期运行所必需的。 如果流量很大,则可能需要运行几对容器。

Here we come to two sets of new terms:

在这里,我们得出了两个新术语:

  • a Task Definition, Task, and Service, and

    任务定义任务服务 ,以及

  • a Cluster, ECS Container Instance, and ECS Container Agent.

    一个 集群 ECS容器实例 ECS集装箱代理

任务定义 (Task Definition)

This is the blueprint describing which Docker containers to run and represents your application. In our example, it would be two containers. would detail the images to use, the CPU and memory to allocate, environment variables, ports to expose, and how the containers interact.

这是描述要运行的Docker容器并代表您的应用程序的蓝图。 在我们的示例中,它将是两个容器。 将详细说明要使用的图像,要分配的CPU和内存,环境变量,要公开的端口以及容器如何交互。

任务 (Task)

An instance of a Task Definition, running the containers detailed within it. Multiple Tasks can be created by one Task Definition, as demand requires.

任务定义的实例,运行其中详细说明的容器。 可以根据需要通过一个任务定义创建多个任务。

服务 (Service)

Defines the minimum and maximum Tasks from one Task Definition run at any given time, autoscaling, and load balancing. In our example, if the CPU was maxed out from the single task we had running, we may want it to add an additional Task.

通过在任何给定时间运行,自动缩放和负载平衡的“任务定义”来定义最小和最大任务。 在我们的示例中,如果CPU超出了我们运行的单个任务,我们可能希望它添加一个额外的Task。

We may, however, want to limit the maximum number of Tasks it can run, since we know that running extra Tasks uses additional resources that cost money.

但是,我们可能希望限制它可以运行的最大任务数,因为我们知道运行额外的任务会花费更多的资源。

Now that we have our Service, its Tasks need to be run somewhere in order to be accessible. It needs to be put on a Cluster, and the container management service will handle it running across one or more ECS Container Instance(s).

现在我们有了服务,它的任务需要在某个地方运行才能访问。 需要将其放在群集上,并且容器管理服务将处理它在一个或多个ECS容器实例上运行。

ECS容器实例和ECS容器代理 (ECS Container Instances and ECS Container Agents)

This is an EC2 instance that has Docker and an ECS Container Agent running on it. A Container Instance can run many Tasks, from the same or different Services.

这是一个运行了Docker和ECS容器代理的EC2实例 。 容器实例可以从相同或不同的服务运行许多任务。

The Agent takes care of the communication between ECS and the instance, providing the status of running containers and managing running new ones.

代理负责ECS与实例之间的通信,提供正在运行的容器的状态并管理正在运行的新容器。

(Cluster)

As seen above, a Cluster is a group of ECS Container Instances. Amazon ECS handles the logic of scheduling, maintaining, and handling scaling requests to these instances. It also takes away the work of finding the optimal placement of each Task based on your CPU and memory needs.

如上所示,群集是一组ECS容器实例。 Amazon ECS处理调度,维护和处理对这些实例的扩展请求的逻辑。 它也省去了根据您的CPU和内存需求为每个Task找到最佳布局的工作。

A Cluster can run many Services. If you have multiple applications as part of your product, you may wish to put several of them on one Cluster. This makes more efficient use of the resources available and minimizes setup time.

群集可以运行许多服务。 如果产品中有多个应用程序,则可能希望将其中几个应用程序放在一个集群中。 这样可以更有效地利用可用资源,并最大程度地缩短设置时间。

结论 (Conclusion)

We have seen how a Dockerized application can be represented by a Task Definition that has a one-to-one relationship with a Service which in turn uses it to create many different Task instances.

我们已经看到了如何通过Task来表示Dockerized应用程序 服务具有一对一关系的定义服务又使用它来创建许多不同的Task实例。

This Service is deployed to a Cluster of ECS Container Instances that provide the pool of resources needed to run and scale your application. Additional Services can be deployed to the same Cluster.

这项服务 部署到集群 ECS容器实例 提供运行和扩展应用程序所需的资源池。 可以将其他服务部署到同一群集。

Amazon ECS, or any container management service, aims to make this as simple as possible, abstracting away many complexities of running infrastructure at scale.

Amazon ECS或任何容器管理服务旨在使此过程尽可能简单,从而消除了大规模运行基础架构的许多复杂性。

As your needs become more complex, the container management service ensures this remains manageable. Using its API or Management Console, you can put definitions in place to add new Container Instances as you need them. This makes sure that there are always a healthy number of Tasks running, and intelligently allocates resources across Services.

随着您的需求变得越来越复杂,容器管理服务可确保这一点易于管理。 使用其API或管理控制台,您可以放置​​定义以根据需要添加新的容器实例。 这样可以确保始终有正常数量的任务在运行,并跨服务智能分配资源。

Thanks for reading!

谢谢阅读!

资源资源 (Resources)

翻译自: https://www.freecodecamp.org/news/amazon-ecs-terms-and-architecture-807d8c4960fd/

亚马逊云服务开通指南

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值