我有一个自动标度组,具有以下设置:
- 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服务被取消,新的被占用,另一个被删除,然后被替换为新的。
我认为这是默认的行为,但看起来并非如此--或者我是不是出了什么问题?
发布于 2016-05-30 15:00:42
您需要为myapp-testing-service重新配置您的ECS服务配置。
将最低健康百分比设置为50。
这将允许您的服务在部署新版本时运行旧版本的1项任务。
https://stackoverflow.com/questions/37527355
复制相似问题