Ruby-on-rails AWS OpsWorks 与 AWS Beanstalk 与 AWS CloudFormation?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21310125/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
AWS OpsWorks vs AWS Beanstalk vs AWS CloudFormation?
提问by ipegasus
I would like to know what are the advantages and disadvantages of using AWS OpsWorks vs AWS Beanstalk and AWS CloudFormation?
我想知道使用 AWS OpsWorks 与 AWS Beanstalk 和 AWS CloudFormation 的优缺点是什么?
I am interested in a system that can be auto scaled to handle any high number of simultaneous web requests (From 1000 requests per minute to 10 million rpm.), including a database layer that can be auto scalable as well.
我对一个可以自动扩展以处理任何大量并发 Web 请求(从每分钟 1000 个请求到 1000 万转)的系统感兴趣,包括一个可以自动扩展的数据库层。
Instead of having a separate instance for each app, Ideally I would like to share some hardware resources efficiently. In the past I have used mostly an EC2 instance + RDS + Cloudfront + S3
理想情况下,我希望有效地共享一些硬件资源,而不是为每个应用程序设置一个单独的实例。过去我主要使用 EC2 实例 + RDS + Cloudfront + S3
The stack system will host some high traffic ruby on rails apps that we are migrating from Heroku, also some python/django apps and some PHP apps as well.
堆栈系统将托管一些我们从 Heroku 迁移的高流量 ruby on rails 应用程序,还有一些 python/django 应用程序和一些 PHP 应用程序。
Thanks in advance.
提前致谢。
采纳答案by Ryan Parman
I would like to know what are the advantages and disadvantages of using AWS OpsWorks vs AWS Beanstalk and AWS CLoudFormation?
我想知道使用 AWS OpsWorks 与 AWS Beanstalk 和 AWS CLoudFormation 的优缺点是什么?
The answer is: it depends.
答案是:视情况而定。
AWS OpsWorks and AWS Beanstalk are (I've been told) simply different ways of managing your infrastructure, depending on how you think about it. CloudFormation is simply a way of templatizing your infrastructure.
AWS OpsWorks 和 AWS Beanstalk(有人告诉我)只是管理基础设施的不同方式,这取决于您的想法。CloudFormation 只是一种模板化基础架构的方式。
Personally, I'm more familiar with Elastic Beanstalk, but to each their own. I prefer it because it can do deployments via Git. It is public information that Elastic Beanstalk uses CloudFormation under the hood to launch its environments.
就个人而言,我更熟悉 Elastic Beanstalk,但对每个人都有自己的了解。我更喜欢它,因为它可以通过 Git 进行部署。Elastic Beanstalk 在幕后使用 CloudFormation 来启动其环境是公开信息。
For my projects, I use both in tandem. I use CloudFormation to construct a custom-configured VPC environment, S3 buckets and DynamoDB tables that I use for my app. Then I launch an Elastic Beanstalk environment inside of the custom VPC which knows how to speak to the S3/DynamoDB resources.
对于我的项目,我同时使用两者。我使用 CloudFormation 来构建用于我的应用程序的自定义配置 VPC 环境、S3 存储桶和 DynamoDB 表。然后我在自定义 VPC 内启动一个 Elastic Beanstalk 环境,该环境知道如何与 S3/DynamoDB 资源对话。
I am interested in a system that can be auto scaled to handle any high number of simultaneous web requests (From 1000 requests per minute to 10 million rpm.), including a database layer that can be auto scalable as well.
我对一个可以自动扩展以处理任何大量并发 Web 请求(从每分钟 1000 个请求到 1000 万转)的系统感兴趣,包括一个可以自动扩展的数据库层。
Under the hood, OpsWorks and Elastic Beanstalk use EC2 + CloudWatch + Auto Scaling, which is capable of handling the loads you're talking about. RDS provides support for scalable SQL-based databases.
在幕后,OpsWorks 和 Elastic Beanstalk 使用 EC2 + CloudWatch + Auto Scaling,它能够处理您正在谈论的负载。RDS 支持可扩展的基于 SQL 的数据库。
Instead of having a separate instance for each app, Ideally I would like to share some hardware resources efficiently. In the past I have used mostly an EC2 instance + RDS + Cloudfront + S3
理想情况下,我希望有效地共享一些硬件资源,而不是为每个应用程序设置一个单独的实例。过去我主要使用 EC2 实例 + RDS + Cloudfront + S3
Depending on what you mean by "somehardware resources", you can always launch standalone EC2 instances alongside OpsWorks or Elastic Beanstalk environments. At present, Elastic Beanstalk supports one webapp per environment. I don't recall what OpsWorks supports.
根据您所说的“某些硬件资源”的含义,您始终可以与 OpsWorks 或 Elastic Beanstalk 环境一起启动独立的 EC2 实例。目前,Elastic Beanstalk 支持每个环境一个 webapp。我不记得 OpsWorks 支持什么。
The stack system will host some high traffic ruby on rails apps that we are migrating from Heroku, also some python/django apps and some PHP apps as well.
堆栈系统将托管一些我们从 Heroku 迁移的高流量 ruby on rails 应用程序,还有一些 python/django 应用程序和一些 PHP 应用程序。
All of this is fully supported by AWS. OpsWorks and Elastic Beanstalk have optimizedthemselves for an array of development environments (Ruby, Python and PHP are all on the list), while EC2 provides raw servers where you can install anything you'd like.
所有这些都得到 AWS 的全面支持。OpsWorks 和 Elastic Beanstalk 已经针对一系列开发环境(Ruby、Python 和 PHP 都在列表中)进行了自我优化,而 EC2 提供了原始服务器,您可以在其中安装任何您想要的东西。
回答by Vietnhi Phuvan
OpsWorks is an orchestration tool like Chef - in fact, it's derived from Chef - Puppet, Ansible or Saltstalk. You use Opsworks to specify the state that you want your network to be in by specifying the state that you want each resource - server instances, applications, storage - to be in. And you specify the state that you want each resource to be in by specifying the value that you want for each attribute of that state. For example, you might want the Apache service to be always up and running and start on boot-up with Apache as the user and Apache as the Linux group.
OpsWorks 是一个类似于 Chef 的编排工具——事实上,它源自 Chef - Puppet、Ansible 或 Saltstalk。您可以使用 Opsworks 通过指定您希望每个资源(服务器实例、应用程序、存储)所处的状态来指定您希望网络所处的状态。并且您指定您希望每个资源所处的状态为该状态的每个属性指定所需的值。例如,您可能希望 Apache 服务始终启动并运行,并在启动时以 Apache 作为用户和 Apache 作为 Linux 组启动。
CloudFormation is a json template (**) that specifies the state of the resource(s) that you want to deploy i.e. you want to deploy an AWS EC2 micro t2 instance in us-east-1 as part of VPC 192.168.1.0/24. In the case of an EC2 instance, you can specify what should run on that resource through your custom bash script in the user-data section of the EC2 resource. CloudFormation is just a template. The template gets fleshed ourt as a running resource only if you run it either through the AWS Management Console for CloudFormation or if you run the aws cli command for Cloudformation i.e. aws cloudformation ...
CloudFormation 是一个 json 模板 (**),用于指定您要部署的资源的状态,即您要在 us-east-1 中部署一个 AWS EC2 micro t2 实例作为 VPC 192.168.1.0/24 的一部分. 对于 EC2 实例,您可以通过 EC2 资源的用户数据部分中的自定义 bash 脚本指定应在该资源上运行的内容。CloudFormation 只是一个模板。仅当您通过 CloudFormation 的 AWS 管理控制台运行模板或运行 Cloudformation 的 aws cli 命令(即 aws cloudformation ...
ElasticBeanstalk is a PAAS- you can upload the specifically Ruby/Rails, node.js or Python/django or Python/Flask apps. If you're running anything else like Scala, Haskell or anything else, create a Docker image for it and upload that Docker image into Elastic Beanstalk (*).
ElasticBeanstalk 是一个 PAAS - 您可以上传专门的 Ruby/Rails、node.js 或 Python/django 或 Python/Flask 应用程序。如果您正在运行 Scala、Haskell 或其他任何东西,请为其创建一个 Docker 映像并将该 Docker 映像上传到 Elastic Beanstalk (*)。
You can do the uploading of your app into Elastic Beanstalk by either running the aws cli for CloudFormation or you create a recipe for Opsworks to upload your app into Elastic Beanstalk. You can also run the aws cli for Cloudformation through Opsworks.
您可以通过运行 CloudFormation 的 aws cli 或为 Opsworks 创建一个配方来将您的应用程序上传到 Elastic Beanstalk,以将您的应用程序上传到 Elastic Beanstalk。您还可以通过 Opsworks 为 Cloudformation 运行 aws cli。
(*) In fact, AWS's documentation on its Ruby app example was so poor that I lost patience and embedded the example app into a Docker image and uploaded the Docker image into Elastic Beanstalk.
(*) 事实上,AWS 对其 Ruby 应用程序示例的文档非常糟糕,以至于我失去了耐心,将示例应用程序嵌入到 Docker 映像中,并将 Docker 映像上传到 Elastic Beanstalk。
(**) As of Sep 2016, Cloudformation also supports YAML templates.
(**) 截至 2016 年 9 月,Cloudformation 还支持 YAML 模板。
回答by Adiii
CloudFormation:AWS CloudFormation is a service that helps you model and set up your Amazon Web Services resources so that you can spend less time managing those resources and more time focusing on your applications that run in AWS.it use template, The templatedescribes the resources you want and their settings.

CloudFormation:AWS CloudFormation 是一项服务,可帮助您对 Amazon Web Services 资源进行建模和设置,以便您可以减少管理这些资源的时间,将更多时间专注于在 AWS 中运行的应用程序。它使用模板,模板描述了资源你想要的和他们的设置。

Elastic Beanstalk
弹性豆茎
With Elastic Beanstalk, you can quickly deploy and manage applications in the AWS cloud without worrying about the infrastructure that runs those applications. In this respect, it is similar to CloudFormation. As a matter of fact, it actually uses CloudFormation templates and scripts to…
借助 Elastic Beanstalk,您可以在 AWS 云中快速部署和管理应用程序,而无需担心运行这些应用程序的基础设施。在这方面,它类似于 CloudFormation。事实上,它实际上使用 CloudFormation 模板和脚本来……
- Create a Load Balancer and Auto Scaling Group.
- Copy code to S3.
- Bootstrap an EC2 instance to download the code from S3 and deploy it.
- 创建负载均衡器和 Auto Scaling 组。
- 将代码复制到 S3。
- 引导 EC2 实例以从 S3 下载代码并进行部署。
OpsWorks
运营中心
OpsWorks enables you to automate management actions so that they are performed automatically and reliably. You can benefit from automatic failover, package management, EBS volume RAID setup, and rule-based or time-based auto scaling.
OpsWorks 使您能够自动执行管理操作,以便自动可靠地执行这些操作。您可以受益于自动故障转移、程序包管理、EBS 卷 RAID 设置以及基于规则或基于时间的自动扩展。
Now some big picture
现在一些大图
回答by Imran Ahmed
In Opsworks you can share "roles" of layers across a stack to use less resources by combining the specific jobs an underlying instance maybe doing.
在 Opsworks 中,您可以通过组合底层实例可能正在执行的特定作业来跨堆栈共享层的“角色”以使用更少的资源。
Layer Compatibility List (as long as security groups are properly set):
层兼容性列表(只要安全组设置正确):
HA Proxy : custom, db-master, and memcached.
MySQL : custom, lb, memcached, monitoring-master, nodejs-app, php-app, rails-app, and web.
Java : custom, db-master, and memcached.
Node.js : custom, db-master, memcached, and monitoring-master
PHP : custom, db-master, memcached, monitoring-master, and rails-app.
Rails : custom, db-master, memcached, monitoring-master, php-app.
Static : custom, db-master, memcached.
Custom : custom, db-master, lb, memcached, monitoring-master, nodejs-app, php-app, rails-app, and web
Ganglia : custom, db-master, memcached, php-app, rails-app.
Memcached : custom, db-master, lb, monitoring-master, nodejs-app, php-app, rails-app, and web.
reference : http://docs.aws.amazon.com/opsworks/latest/userguide/layers.html
参考:http: //docs.aws.amazon.com/opsworks/latest/userguide/layers.html
回答by Yogesh Funde
AWS Beanstalk:It is Deploy and manage applications in the AWS cloud without worrying about the infrastructure that runs yor web applications with Elastic Beanstalk. No need to worry about EC2 or else installations.
AWS Beanstalk:它是在 AWS 云中部署和管理应用程序,而无需担心使用 Elastic Beanstalk 运行您的 Web 应用程序的基础设施。无需担心 EC2 或其他安装。
AWS OpsWorksAWS OpsWorks is nothing but an application management service that makes it easy for the new DevOps users to model & manage the entire their application
AWS OpsWorksAWS OpsWorks 只不过是一种应用程序管理服务,它使新的 DevOps 用户可以轻松地对整个应用程序进行建模和管理
回答by Gladiator
AWS CloudFormation - Create and Update your environments.
AWS CloudFormation - 创建和更新您的环境。
AWS Opsworks - Manage your systems inside that environments like we do with Chef or Puppet
AWS Opsworks - 在该环境中管理您的系统,就像我们使用 Chef 或 Puppet 所做的那样
AWS Beanstalk - Create, Manage and Deploy.
AWS Beanstalk - 创建、管理和部署。
But personally I like CloudFormation and OpsWorks both by using its full power for what they are meant for.
但就我个人而言,我喜欢 CloudFormation 和 OpsWorks,因为它们可以充分利用它们的功能。
Use CloudFormation to create your environment then you can call Opsworks from cloud formation scripts to launch your machine. Then you will have Opsworks stack to manage it. For example add a user in linux box by using Opsworks or do patching of your boxes using chef recipes. You can write down chef recipes for deployment also. Otherwise you can use CodeDeploy specifically build for deployment.
使用 CloudFormation 创建您的环境,然后您可以从 Cloud Formation 脚本调用 Opsworks 来启动您的机器。然后您将拥有 Opsworks 堆栈来管理它。例如,使用 Opsworks 在 linux box 中添加用户或使用厨师食谱修补您的 box。您也可以写下部署的厨师食谱。否则,您可以使用 CodeDeploy 专门构建进行部署。
回答by Sanjeev Singh
AWS OpsWorks- This is a part of AWS management service. It helps to configure the application using scripting. It uses Chef as the devops framework for this application management and operation. There are templates which can be used for configuration of server, database, storage. The templates can also be customized to perform any other task. DevOps Engineers have control on application's dependencies and infrastructure.
AWS OpsWorks- 这是 AWS 管理服务的一部分。它有助于使用脚本配置应用程序。它使用 Chef 作为此应用程序管理和操作的 DevOps 框架。有可用于配置服务器、数据库、存储的模板。还可以自定义模板以执行任何其他任务。DevOps 工程师可以控制应用程序的依赖项和基础架构。
AWS Beanstalk- It provides the environment for language like Java, Node Js, Python, Ruby Go. Elastic Bean stalk provide the resource to run the application. Developers not to worry about the infrastructure and they don't have control on infrastructure.
AWS Beanstalk- 它为 Java、Node Js、Python、Ruby Go 等语言提供环境。Elastic Bean stalk 提供运行应用程序的资源。开发人员不必担心基础设施,他们无法控制基础设施。
AWS CloudFormation- CloudFormation has sample templates to manage the AWS resources in order.
AWS CloudFormation- CloudFormation 有示例模板来按顺序管理 AWS 资源。
回答by siomes
As many others have commented AWS Beanstalk, AWS OpsWorks and AWS Cloud Formation offers different solutions for different problems.
正如许多其他人评论的那样,AWS Beanstalk、AWS OpsWorks 和 AWS Cloud Formation 为不同的问题提供了不同的解决方案。
In order to acomplish with
为了完成
I am interested in a system that can be auto scaled to handle any high number of simultaneous web requests (From 1000 requests per minute to 10 million rpm.), including a database layer that can be auto scalable as well.
And taking into consideration you are in migration process I strongly recommend you to start taking a look at AWS Lambda & AWS DynamoDB solution (or hybrid one).
考虑到您正在迁移过程中,我强烈建议您开始查看 AWS Lambda 和 AWS DynamoDB 解决方案(或混合解决方案)。
Both two are designed for autoscaling in a simple way and may be a very cheap solution.
两者都是为以简单的方式自动缩放而设计的,可能是一种非常便宜的解决方案。
回答by neill
Just use terraform and ECS or EKS.
只需使用 terraform 和 ECS 或 EKS。
opsworks, elastic beanstalk and cloudformation old tech now. -)
opsworks、elastic beanstalk 和 cloudformation 旧技术。-)

