Skip to content
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

Swarm mode feature request #45

Open
psoares opened this issue Aug 4, 2016 · 2 comments
Open

Swarm mode feature request #45

psoares opened this issue Aug 4, 2016 · 2 comments

Comments

@psoares
Copy link

psoares commented Aug 4, 2016

Hi,
It would be great if collectd could be launched as a global service using the new swarm mode in 1.12.
Right now, the only thing preventing me from doing so is I don't know how to set the hostname in this mode.

When launching node by node, I can do something like :
docker run --restart always --name collectd -d -v /var/run/docker.sock:/var/run/docker.sock -e GRAPHITE_HOST=xx.xx.xx.xx -e COLLECTD_HOST=hostname -e APP_LABEL_KEY=collectd_docker_app bobrik/collectd-docker

Now, when trying to run this as a global service from a swarm master, I tried to do this :
docker service create --mode global --name collectd --mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock -e GRAPHITE_HOST=xx.xx.xx.xx -e COLLECTD_HOST=hostname -e APP_LABEL_KEY=collectd_docker_app --restart-max-attempts 10 --restart-condition any bobrik/collectd-docker

...which indeed launches a container on each of my swarm nodes, BUT the hostname is set to the swarm leader's name on every host.

I'll try to find a workaround, but if you see an obvious way of doing this, it would be great !

@paulcgt
Copy link

paulcgt commented Jun 13, 2018

Have you found a workaround for this @psoares ?

@psoares
Copy link
Author

psoares commented Aug 8, 2018

No. Sorry...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants