0
我按照步骤在Ubuntu 16上安装ECS客户端,但是当我尝试运行ECS容器代理时,它不断重启,当我查看日志时亚马逊ECS“引用的群集不活动”
2016-12-07T06:01:39Z [INFO] Starting Agent: Amazon ECS Agent - v1.13.1 (efe53c6)
2016-12-07T06:01:39Z [INFO] Loading configuration
2016-12-07T06:01:39Z [INFO] Checkpointing is enabled. Attempting to load state
2016-12-07T06:01:39Z [INFO] Loading state! module="statemanager"
2016-12-07T06:01:39Z [INFO] Event stream ContainerChange start listening...
2016-12-07T06:01:39Z [INFO] Detected Docker versions [1.17 1.18 1.19 1.20 1.21 1.22 1.23]
2016-12-07T06:01:39Z [INFO] Registering Instance with ECS
2016-12-07T06:01:39Z [ERROR] Could not register module="api client" err="ClientException: The referenced cluster was inactive.
status code: 400, request id: 9eaa4124-bc42-11e6-9cf1-7559dea2bdf8"
2016-12-07T06:01:39Z [ERROR] Error registering: ClientException: The referenced cluster was inactive.
status code: 400, request id: 9eaa4124-bc42-11e6-9cf1-7559dea2bdf8
我没有找到对谷歌这个错误的引用,我不知道什么是错的......
我需要在ECS仪表盘创建群集名称? 我有附加器的容器作用,我的EC2实例,它允许创建集群,所以我不认为这个问题来自于这里...
我的搬运工运行配置
sudo docker run --name ecs-agent \
--detach=true \
--restart=on-failure:10 \
--volume=/var/run/docker.sock:/var/run/docker.sock \
--volume=/var/log/ecs/:/log \
--volume=/var/lib/ecs/data:/data \
--net=host \
--env=ECS_LOGFILE=/var/log/ecs-agent.log \
--env=ECS_LOGLEVEL=info \
--env=ECS_DATADIR=/data \
--env=ECS_CLUSTER=my-cluster \
--env=ECS_ENABLE_TASK_IAM_ROLE=true \
--env=ECS_ENABLE_TASK_IAM_ROLE_NETWORK_HOST=true \
amazon/amazon-ecs-agent:latest
谢谢!我没有意识到'AmazonEC2ContainerServiceRole'没有包含创建负载平衡器的授权。但是你确定如果给予适当的权限,集群不会自动创建吗? –
是的,逻辑是[here](https://github.com/aws/amazon-ecs-agent/blob/v1.13.1/agent/api/ecsclient/client.go#L101-L120);它只创建'default',并且只有当'ECS_CLUSTER'没有被指定时(我写了一些这样的代码)。 –