为应用程序负载均衡器启用可用区转移 - Elastic Load Balancing

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

为应用程序负载均衡器启用可用区转移

可用区转移默认处于禁用状态,并且必须在每个应用程序负载均衡器上启用。这确保了您仅能使用所需的特定应用程序负载均衡器来启动可用区转移。有关更多信息,请参阅 应用程序负载均衡器的可用区转移

Console
启用可用区转移
  1. 打开 Amazon EC2 控制台,网址为https://console.aws.amazon.com/ec2/

  2. 在导航窗格上的 Load Balancing(负载均衡)下,选择 Load Balancers(负载均衡器)。

  3. 选择该应用程序负载均衡器。

  4. 属性选项卡上,选择编辑

  5. 可用区路由配置部分,对于 ARC 可用区转移集成,请选择 启用

  6. 选择保存更改

AWS CLI
要启用可用区转移

使用带 zonal_shift.config.enabled 属性的 modify-load-balancer-attributes 命令。

aws elbv2 modify-load-balancer-attributes \ --load-balancer-arn load-balancer-arn \ --attributes "Key=zonal_shift.config.enabled,Value=true"
CloudFormation
要启用可用区转移

更新AWS::ElasticLoadBalancingV2::LoadBalancer资源以包含该zonal_shift.config.enabled属性。

Resources: myLoadBalancer: Type: 'AWS::ElasticLoadBalancingV2::LoadBalancer' Properties: Name: my-alb Type: application Scheme: internal IpAddressType: dualstack Subnets: - !Ref subnet-AZ1 - !Ref subnet-AZ2 SecurityGroups: - !Ref mySecurityGroup LoadBalancerAttributes: -Key: "zonal_shift.config.enabled" Value: "true"