[英]Auto-scaling load balanced EC2 instances by example
I am reading up on AWS Auto Scaling Groups and trying to understand (from a network-perspective) how the following resources all fit together:我正在阅读AWS Auto Scaling Groups并试图(从网络角度)了解以下资源如何组合在一起:
I understand what each of these does in theory, but in practice, I'm having trouble seeing the forest through the trees with how they all snap together.我理解它们在理论上的作用,但在实践中,我很难通过树木看到森林以及它们是如何结合在一起的。 For example: do I configure the EC2 instances to be members of the Security Group?例如:我是否将 EC2 实例配置为安全组的成员? Or do I do that at the balancer-level?还是我在平衡器级别这样做? If I attach the ALB to the Auto Scaling Group, then why would I need to do any additional configuration with an ALB Target Group?如果我将 ALB 附加到 Auto Scaling 组,那么我为什么需要对 ALB 目标组进行任何其他配置? When it comes to routing, do I route port 80 traffic to the ALB or the Auto Scale Group?在路由方面,我是将端口 80 流量路由到 ALB 还是 Auto Scale Group?
I know these are lots of small questions, so the main question here is: how do all of these snap together to provide a load balanced web server hosted on EC2 instances?我知道这些都是很多小问题,所以这里的主要问题是:如何将所有这些组合在一起以提供托管在 EC2 实例上的负载均衡 Web 服务器? Ultimately I need to configure all of this inside a CloudFormation template, but a diagram or explanation to help me configure everything manually is probably the best place for me to start.最终,我需要在 CloudFormation 模板中配置所有这些,但是帮助我手动配置所有内容的图表或说明可能是我开始的最佳位置。 Thanks for any help!谢谢你的帮助!
do I configure the EC2 instances to be members of the Security Group?如何将 EC2 实例配置为安全组的成员? Or do I do that at the balancer-level?还是我在平衡器级别这样做?
The EC2 instances should be a member of one security group. EC2 实例应该是一个安全组的成员。 The Load Balancer should be a member of another security group.负载均衡器应该是另一个安全组的成员。 The Load Balancer's security group should allow incoming traffic from the Internet.负载均衡器的安全组应该允许来自 Internet 的传入流量。 The EC2 instances should allow incoming traffic from the load balancer. EC2 实例应允许来自负载均衡器的传入流量。
If I attach the ALB to the Auto Scaling Group, then why would I need to do any additional configuration with an ALB Target Group?如果我将 ALB 附加到 Auto Scaling 组,那么我为什么需要对 ALB 目标组进行任何其他配置?
If you are using an auto-scaling group to create the instances, then you don't have to do any manual updates to the target group, the auto-scaling group will handle those updates for you.如果您使用自动伸缩组来创建实例,那么您不必对目标组进行任何手动更新,自动伸缩组将为您处理这些更新。
When it comes to routing, do I route port 80 traffic to the ALB or the Auto Scale Group?在路由方面,我是将端口 80 流量路由到 ALB 还是 Auto Scale Group?
An Auto-scaling group is not a resource that exists in your network. Auto-scaling 组不是您网络中存在的资源。 It is a construct within AWS that just creates/removes EC2 servers for you based on metrics.它是 AWS 中的一个构造,它只是根据指标为您创建/删除 EC2 服务器。 The traffic goes to the load balancer, and the load balancer sends it to the EC2 instances in the target group.流量进入负载均衡器,负载均衡器将其发送到目标组中的 EC2 实例。
I know these are lots of small questions, so the main question here is: how do all of these snap together to provide a load balanced web server hosted on EC2 instances?我知道这些都是很多小问题,所以这里的主要问题是:如何将所有这些组合在一起以提供托管在 EC2 实例上的负载均衡 Web 服务器? Ultimately I need to configure all of this inside a CloudFormation template, but a diagram or explanation to help me configure everything manually is probably the best place for me to start.最终,我需要在 CloudFormation 模板中配置所有这些,但是帮助我手动配置所有内容的图表或说明可能是我开始的最佳位置。
It's a bit much to ask somebody on here to spend their free time creating a diagram for you.要求这里的人花费他们的空闲时间为您创建图表有点过分。 I suggest looking at the AWS reference WordPress implementations which they tend to use for providing reference implementations of auto-scaled web server environments.我建议查看 AWS 参考 WordPress 实施,他们倾向于使用这些实施来提供自动扩展 Web 服务器环境的参考实施。
See the "WordPress scalable and durable" CloudFormation template example here .请在此处查看“WordPress 可扩展且持久的”CloudFormation 模板示例。
See the AWS WordPress Reference Architecture project here , which includes a diagram.请参阅此处的 AWS WordPress 参考架构项目,其中包含一个图表。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.