You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 !
The text was updated successfully, but these errors were encountered:
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 !
The text was updated successfully, but these errors were encountered: