admin管理员组文章数量:1123412
I have an ECS service running a container with two port mappings:
"portMappings": [
{
"containerPort": 15672,
"hostPort": 15672,
"protocol": "tcp"
},
{
"containerPort": 5672,
"hostPort": 5672,
"protocol": "tcp"
}
]
I am using an AWS Network Load Balancer (NLB) with two listeners:
Listener 1 on port 15672, associated with Target Group 1 Listener 2 on port 5672, associated with Target Group 2 However, when the ECS task starts, it only registers with Target Group 2 (port 5672) for both listeners, even though the container exposes both port 15672 and 5672. I want the task to be registered with both target groups, one for each port.
What I’ve checked so far: Listener and Target Group Setup: Both listeners (on ports 15672 and 5672) are correctly configured on the NLB, with each targeting its own respective target group. ECS Service Configuration: The service includes both port mappings in the container definition. Health Checks: Health checks for both target groups are configured to check their respective ports (15672 for Target Group 1 and 5672 for Target Group 2). Question: Why is the ECS task only registering with Target Group 2 (port 5672) despite having a valid port mapping for both 15672 and 5672? What steps should I take to ensure that the task is properly registered with both target groups based on the respective listener ports?
I have an ECS service running a container with two port mappings:
"portMappings": [
{
"containerPort": 15672,
"hostPort": 15672,
"protocol": "tcp"
},
{
"containerPort": 5672,
"hostPort": 5672,
"protocol": "tcp"
}
]
I am using an AWS Network Load Balancer (NLB) with two listeners:
Listener 1 on port 15672, associated with Target Group 1 Listener 2 on port 5672, associated with Target Group 2 However, when the ECS task starts, it only registers with Target Group 2 (port 5672) for both listeners, even though the container exposes both port 15672 and 5672. I want the task to be registered with both target groups, one for each port.
What I’ve checked so far: Listener and Target Group Setup: Both listeners (on ports 15672 and 5672) are correctly configured on the NLB, with each targeting its own respective target group. ECS Service Configuration: The service includes both port mappings in the container definition. Health Checks: Health checks for both target groups are configured to check their respective ports (15672 for Target Group 1 and 5672 for Target Group 2). Question: Why is the ECS task only registering with Target Group 2 (port 5672) despite having a valid port mapping for both 15672 and 5672? What steps should I take to ensure that the task is properly registered with both target groups based on the respective listener ports?
Share Improve this question asked 16 hours ago Ivan YalovetsIvan Yalovets 11 bronze badge1 Answer
Reset to default 0Just having the ports mapped in the service is not enough. You have to register both target groups with the ECS service, so that the ECS service knows exactly which target groups it needs to update as it starts and stops tasks. This feature of ECS is documented here.
本文标签: amazon web servicesECS Task Registers Only on One Port for Both NLB Target GroupsStack Overflow
版权声明:本文标题:amazon web services - ECS Task Registers Only on One Port for Both NLB Target Groups - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736570213a1944760.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论