更新 Network Load Balancer 目標群組的運作狀態檢查設定 - Elastic Load Balancing

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

更新 Network Load Balancer 目標群組的運作狀態檢查設定

您可以隨時更新目標群組的運作狀態檢查設定。如需運作狀態檢查設定的清單,請參閱 運作狀態檢查設定

Console
更新運作狀態檢查設定
  1. 前往 https://console.aws.amazon.com/ec2/ 開啟 Amazon EC2 主控台。

  2. 在導覽窗格的負載平衡中,選擇目標群組

  3. 選擇目標群組的名稱,以開啟其詳細資訊頁面。

  4. Health checks (運作狀態檢查) 標籤上,選擇 Edit (編輯)

  5. 編輯運作狀態檢查設定頁面上,視需要修改設定。

  6. 選擇儲存變更

AWS CLI
更新運作狀態檢查設定

使用 modify-target-group 命令。下列範例會更新 HealthyThresholdCountHealthCheckTimeoutSeconds 設定。

aws elbv2 modify-target-group \ --target-group-arn target-group-arn \ --healthy-threshold-count 3 \ --health-check-timeout-seconds 20
CloudFormation
更新運作狀態檢查設定

更新 AWS::ElasticLoadBalancingV2::TargetGroup 資源,以包含更新的運作狀態檢查設定。下列範例會更新 HealthyThresholdCountHealthCheckTimeoutSeconds 設定。

Resources: myTargetGroup: Type: 'AWS::ElasticLoadBalancingV2::TargetGroup' Properties: Name: my-target-group Protocol: TCP Port: 80 TargetType: instance VpcId: !Ref myVPC HealthyThresholdCount: 3 HealthCheckTimeoutSeconds: 20