0

I am setting up a simple cluster using docker on several hosts. Before using docker the processes were simply started with a argument giving the address to a config server. The first thing each process does is to connect to the config server, get the addresses (host and port) of all the other services as well as register itself with host (and several different ports, one for each the services it provides).

However, it does not seem to be possible to dockerize this workflow? Since a process in a container seems not to be able to get the address and ports on the host (based on for example How to get the IP address of the docker host from inside a docker container) it does not know what to register itself as. Is this really not possible?

If not, are there any alternative ways this sort of setup is intended to be run using docker?

Community
  • 1
  • 1
Vskrap
  • 43
  • 3
  • http://2mohitarora.blogspot.ie/2014/08/service-discovery-using-consul.html – Mark O'Connor Feb 17 '15 at 22:08
  • Hi, thanks for the link, have now been reading/trying for a while and it does indeed seem to to do what I need. However, I fail to understand if the DNS lookup service (SRV) can be used to map several docker containers on the same host. I.e. it seems like the port that will be listed in the records is given in the config.json file (thus the same for all the containers). Thus, if I start 5 app containers I have to use different host ports, (e.g. 80, 81, ..) but when my consumer does a lookup to find the services all of them will be listed as using port 80 (as set in the config file)? – Vskrap Feb 18 '15 at 21:34
  • I think effecrively what I tried to ask is, is consul based on the underlying assumption that a particulat service is offered on a particular port? (Ie not designed to run for example four nodes spread on two physical machines?) – Vskrap Feb 19 '15 at 05:49

0 Answers0