I’m batteling with Consul on Rancher still.
I’ve got a custom Docker image that will fetch the Rancher primary IP for the container upon startup.
The Consul agents then bind and advertise this address.
However, very often I get the following error:
2016-10-06 06:07:37==> Starting Consul agent...
2016-10-06 06:07:37==> Starting Consul agent RPC...
2016-10-06 06:07:37==> Error starting http servers: Failed to get Listen on 10.42.225.150:8500: listen tcp 10.42.225.150:8500: bind: cannot assign requested address
And the container will restart over and over again, utill it suddenly starts working for who knows what reason.
Is this some sort of race condition? that the primary IP is not quite available for the container just yet when it starts?