【发布时间】:2019-11-03 17:55:52
【问题描述】:
我正在尝试在具有应用程序负载均衡器的 ecs 集群上创建服务,以运行具有两个容器、一个 api 和 redis 的任务定义。当我尝试创建服务时,我收到错误“服务创建失败/n 服务创建失败:”,它没有提供有关错误的任何信息。
我希望该服务通过让该服务为我创建一个新的目标组来自动注册我的 ecs ec2 的正确端口。我的 api 容器的主机端口:0,容器端口:3000。我的 redis 容器的主机端口:0 和容器端口:6379,都使用 tcp。
我将在下面粘贴我的服务配置的文本版本。
Review
Cluster: rest-api-explorer
Launch type: EC2
Task Definition: rest-api-explorer:19
Service name: rest-api-service
Service type: DAEMON
Minimum healthy: percent 0
Maximum percent: 100
Configure network
Health check grace period: 10
Container Name: api-rest-explorer
Container Port: 3000
ELB Name: rest-api-explorer
Target Group: ecs-created-rest-api-service
Health Check Path: /api/rest/console
Listener Port: 3000
Path-pattern: /api/rest/console
Service Role: AWSServiceRoleForECS
Set Auto Scaling (optional)
not configured
【问题讨论】:
-
您是否尝试过使用控制台或 CLI?要尝试使用 CLI,您可以转到此链接:docs.aws.amazon.com/cli/latest/reference/ecs/… 并搜索“示例 4:在负载均衡器后面创建新服务”
-
你能在没有服务的情况下运行任务吗?
-
是的,我可以在没有服务的情况下运行任务,并且手动将任务注册到目标组并且它通过了健康检查,但它不会作为服务运行。
标签: amazon-web-services amazon-ec2 amazon-ecs aws-application-load-balancer