-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
start ecs
doesn't seem to start ecs-agent
#75
Comments
Hi @davidvuong. ecs-init and ecs-agent both log to files in |
Hey @narehayrapetyan, Here's the log for both files in ecs-init.log:
ecs-agent.log:
|
This might also be useful. Cloud init logs before and after the
and this is what I get:
|
@nmeyerhans Yep you're right. It seems like there's a timing issue. I forced a Is there another way I can fix this aside from forcing an arbitrary sleep time? |
Aside from a fixed sleep, another option would be to write a polling loop, retrying your curl until you get a meaningful response. I'd recommend a short sleep (probably 1 second is fine) between loop iterations and a fatal timeout of maybe 1 or two minutes so you avoid looping forever in case the agent never starts for some reason. In theory we could implement such a loop in ecs-init itself or in the upstart config we use to start it, so I'll leave this issue open as a feature request. It's possible that there are issues with this idea that I haven't considered yet, so it may not be the right thing to do. |
Based on my understanding, the problem here is "start ecs" just works as an interface to tell upstart init system to start agent, but starting agent is async. Adding loop in ecs-init or upstart config will not make "start ecs" command itself to wait for agent successfully started and then return. So the retry mentioned above would be the way to handle your case now. Close the issue considering there is no action items on our side. Feel free to reopen it if you have any questions. |
Here is everything in
user-data
(largely copied from http://docs.datadoghq.com/integrations/ecs/#create-an-ecs-task):This is the tail of cloud-init-output:
Additional information:
ECS_CLUSTER=${aws_ecs_cluster.main.name}
but assume thatECS_CLUSTER=main
curl
I seem can't connectsudo start ecs
but I get the same results... and the contents of my rc.local file looks like this:
There isn't a value next to
--container-instances
because I couldn't fetch any metadata from the ecs-agent 😢Any ideas?
The text was updated successfully, but these errors were encountered: