简体   繁体   English

AWS:是否可以将(ELB / ALB)映射到ELB?

[英]AWS: is it possible to map (ELB/ALB) to ELB?

ELB: Elastic Load Balancer ALB: Application Load Balancer ELB: Elastic Load Balancer ALB:应用程序负载均衡器

I am trying to map elb/alb on aws to another elb (ex: http://my-elb-domain.com ), 我试图将aws上的elb / alb映射到另一个elb(例如: http//my-elb-domain.com ),

elb/alb -> elb elb / alb - > elb

in alb: I didn't find a way to register elb as targets. 在alb:我没有找到将elb注册为目标的方法。 in elb: only maps to instances 在elb中:仅映射到实例

This is not possible. 这是不可能的。

Both the Classic Load Balancer and Target Groups for the Application Load Balancer only accept Amazon EC2 instances as targets. 应用程序负载均衡器的经典负载均衡器和目标组仅接受Amazon EC2实例作为目标。

不可以。您不能直接将一个ELB映射到另一个ELB。

Explanation 说明

We have found a roundabout way to accomplish this via the AWS CLI, and are currently using it in production to route traffic. 我们已经找到了一种通过AWS CLI实现此目的的迂回方式,目前正在生产中使用它来路由流量。 Note that the solution below ends up routing to the same instances behind an ELB, but not through the ELB itself. 请注意,下面的解决方案最终路由到ELB后面的相同实例,但不是通过ELB本身。 Here's how it works: 以下是它的工作原理:

  1. When created an elastic beanstalk environment comes with an automatically generated autoscaling group 创建弹性beanstalk环境时,会自动生成一个自动缩放组
  2. An auto-scaling group can be attached to up to 10 target groups via the CLI 可以通过CLI将自动扩展组连接到最多10个目标组
  3. That target group can be the direct target of an ALB 该目标群体可以成为ALB的直接目标

Visual Flow 视觉流程

Traffic -> ALB -> Target Group -> Autoscaling Group -> Same Instances ELB Points To 流量 - > ALB - >目标组 - >自动缩放组 - >相同实例ELB指向

Setup Instructions 设置说明

  1. Create an Elastic Beanstalk application 创建Elastic Beanstalk应用程序
  2. Get the name of the Autoscaling group generated for the Elastic Beanstalk app 获取为Elastic Beanstalk应用程序生成的Autoscaling组的名称
  3. Create a target group (with no targets), save the ARN for the target group. 创建目标组(没有目标),保存目标组的ARN。
  4. Create your ALB, setting its target to the target group create in step #3 创建ALB,将其目标设置为步骤#3中创建的目标组
  5. Attach the target group to your Autoscaling group via the AWS CLI 通过AWS CLI将目标组附加到Autoscaling组

    aws autoscaling attach-load-balancer-target-groups --auto-scaling-group-name {AutoScalingGroupName} --target-group-arns {TargetGroupARN}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM