我在亚马逊上有一个自动缩放组,它产生服务器实例。
我的 aws-cli 配置是:
[default]
s3 =
signature_version = s3v4
addressing_style = path
region = eu-central-1
我的 ecs-agent 配置在实例启动时使用 aws-cli 从 s3 读取,如下所示:
ECS_CLUSTER=cluster-mongodb
ECS_ENGINE_AUTH_TYPE=dockercfg
ECS_ENGINE_AUTH_DATA={"domain.com":{"auth":"bsaewfgvewgf23g9hv3","email":""}}
遗憾的是,生成的实例上的 ecs-agent 总是在 10 秒后重新启动,而不是注册到集群“cluster-mongodb”。
错误日志在这里:
2016-02-05T14:40:47Z [INFO] Starting Agent: Amazon ECS Agent - v1.7.1 (007985c)
2016-02-05T14:40:47Z [INFO] Loading configuration
2016-02-05T14:40:47Z [INFO] Checkpointing is enabled. Attempting to load state
2016-02-05T14:40:47Z [INFO] Loading state! module="statemanager"
2016-02-05T14:40:47Z [INFO] Detected Docker versions [1.17 1.18 1.19 1.20]
2016-02-05T14:40:47Z [INFO] Registering Instance with ECS
2016-02-05T14:41:07Z [ERROR] Could not register module="api client" err="RequestError: send request failed
caused by: Post https://ecs.eu-central-1.amazonaws.com/: net/http: request canceled while waiting for connection"
2016-02-05T14:41:07Z [ERROR] Error registering: RequestError: send request failed
caused by: Post https://ecs.eu-central-1.amazonaws.com/: net/http: request canceled while waiting for connection
有人见过这个吗?这可能与混乱的安全组/LB 配置有关吗?
提前致谢
[编辑] 找到了解决方案:
检查子网是否注册到正确的路由表(vpc -> 路由表)。就我而言,这是错误的。
此外,我的实例需要由 Autoscaling 组的启动配置分配的公共 IP,但这对我的设置很特殊。