[英]Blocked ports and autoscaling group in aws
我有一個具有以下設置的自動縮放組:
- name: configure auto-scaling group
ec2_asg:
name: "{{ application_name }}-{{ application_environment }}-auto-scaling-group"
availability_zones:
- "{{ region }}a"
- "{{ region }}b"
- "{{ region }}c"
state: present
launch_config_name: "{{ application_name }}-{{ application_environment }}-launch-configuration"
min_size: 1
max_size: 2
region: "{{ region }}"
desired_capacity: 2
tags:
- environment: "{{application_environment}}"
vpc_zone_identifier:
- "{{ vpc.subnets[0].id }}"
- "{{ vpc.subnets[1].id }}"
- "{{ vpc.subnets[2].id }}"
它正在旋轉兩個ec2實例。
在這兩種情況下,都有一個運行nginx的服務監聽端口80。我知道我不能兩次使用端口80。 該服務的期望容量為2,但我願意在滾動更新期間運行一個。
但是,如果我更新服務和任務定義,則會收到以下錯誤:
ERROR: (service myapp-testing-service) was unable to place a task because no container instance met all of its requirements. The closest matching (container-instance 24d9d97e-c979-41a3-a438-212390612ae3) is already using a port required by your task. For more information, see the Troubleshooting section of the Amazon ECS Developer Guide.
沒錯,端口被阻塞。 在這種情況下,我想發生的事情是關閉了一個Nginx服務,使用了新服務,然后關閉了另一個服務,並替換為新服務。
我以為這是默認行為,但看起來好像不是-還是我出了點問題?
您將需要為myapp-testing-service
重新配置ECS服務配置。
將最低健康百分比設置為50。
這將使您的服務在部署新版本時可以運行舊版本的RUN 1任務。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.